修复 src 结构
This commit is contained in:
9
src/component/tabItem/index.ts
Normal file
9
src/component/tabItem/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App } from "vue";
|
||||
import Component from "./index.vue";
|
||||
import type { IDefineComponent } from "../type/index";
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || "LayTabItem", Component);
|
||||
};
|
||||
|
||||
export default Component as IDefineComponent;
|
||||
30
src/component/tabItem/index.vue
Normal file
30
src/component/tabItem/index.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<div class="layui-tab-item" :class="[active === id ? 'layui-show' : '']">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "LayTabItem",
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup name="LayTabItem" lang="ts">
|
||||
import { withDefaults, defineProps, inject, Ref } from "vue";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
id: string;
|
||||
title: string;
|
||||
closable?: boolean;
|
||||
}>(),
|
||||
{
|
||||
closable: true,
|
||||
}
|
||||
);
|
||||
|
||||
const active = inject("active");
|
||||
const slotsChange: Ref<boolean> = inject("slotsChange") as Ref<boolean>;
|
||||
slotsChange.value = !slotsChange.value;
|
||||
</script>
|
||||
Reference in New Issue
Block a user