refactor(project): remove the use of core internal bem syntax
This commit is contained in:
@@ -1 +1,2 @@
|
||||
export { default as Tabs } from './tabs/tabs.vue';
|
||||
export { default as TabsChrome } from './tabs-chrome/tabs.vue';
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { TabItem } from '@vben-core/typings';
|
||||
import type { TabDefinition } from '@vben-core/typings';
|
||||
|
||||
import type { TabsProps } from '../../types';
|
||||
import type { TabConfig, TabsProps } from '../../types';
|
||||
|
||||
import { computed, nextTick, onMounted, ref, watch } from 'vue';
|
||||
|
||||
@@ -25,7 +25,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
tabs: () => [],
|
||||
});
|
||||
|
||||
const emit = defineEmits<{ close: [string]; unpin: [TabItem] }>();
|
||||
const emit = defineEmits<{ close: [string]; unpin: [TabDefinition] }>();
|
||||
const active = defineModel<string>('active');
|
||||
|
||||
const contentRef = ref();
|
||||
@@ -56,12 +56,14 @@ const layout = () => {
|
||||
tabWidth.value = width;
|
||||
};
|
||||
|
||||
const tabsView = computed(() => {
|
||||
const tabsView = computed((): TabConfig[] => {
|
||||
return props.tabs.map((tab) => {
|
||||
return {
|
||||
...tab,
|
||||
affixTab: !!tab.meta?.affixTab,
|
||||
closable: tab.meta?.tabClosable ?? true,
|
||||
closable: Reflect.has(tab.meta, 'tabClosable')
|
||||
? !!tab.meta.tabClosable
|
||||
: true,
|
||||
icon: tab.meta.icon as string,
|
||||
key: tab.fullPath || tab.path,
|
||||
title: (tab.meta?.title || tab.name) as string,
|
||||
@@ -85,7 +87,8 @@ onMounted(() => {
|
||||
function handleClose(key: string) {
|
||||
emit('close', key);
|
||||
}
|
||||
function handleUnpinTab(tab: TabItem) {
|
||||
|
||||
function handleUnpinTab(tab: TabConfig) {
|
||||
emit('unpin', tab);
|
||||
}
|
||||
</script>
|
||||
|
@@ -1,5 +0,0 @@
|
||||
<script lang="ts" setup></script>
|
||||
|
||||
<template>
|
||||
<div></div>
|
||||
</template>
|
11
packages/@core/ui-kit/tabs-ui/src/components/tabs/tabs.vue
Normal file
11
packages/@core/ui-kit/tabs-ui/src/components/tabs/tabs.vue
Normal file
@@ -0,0 +1,11 @@
|
||||
<script lang="ts" setup>
|
||||
import { VbenScrollbar } from '@vben-core/shadcn-ui';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="bg-accent size-full">
|
||||
<VbenScrollbar>
|
||||
<slot></slot>
|
||||
</VbenScrollbar>
|
||||
</div>
|
||||
</template>
|
Reference in New Issue
Block a user