diff --git a/docs/src/en/guide/essentials/settings.md b/docs/src/en/guide/essentials/settings.md index d09338a4..68fef3e7 100644 --- a/docs/src/en/guide/essentials/settings.md +++ b/docs/src/en/guide/essentials/settings.md @@ -226,7 +226,7 @@ const defaultPreferences: Preferences = { width: 230, }, tabbar: { - dragable: true, + draggable: true, enable: true, height: 36, keepAlive: true, @@ -406,7 +406,7 @@ interface ShortcutKeyPreferences { interface TabbarPreferences { /** Whether dragging of multiple tabs is enabled */ - dragable: boolean; + draggable: boolean; /** Whether multiple tabs are enabled */ enable: boolean; /** Tab height */ diff --git a/docs/src/guide/essentials/settings.md b/docs/src/guide/essentials/settings.md index 15ac5c3d..9a64065a 100644 --- a/docs/src/guide/essentials/settings.md +++ b/docs/src/guide/essentials/settings.md @@ -248,7 +248,7 @@ const defaultPreferences: Preferences = { width: 230, }, tabbar: { - dragable: true, + draggable: true, enable: true, height: 36, keepAlive: true, @@ -430,7 +430,7 @@ interface ShortcutKeyPreferences { interface TabbarPreferences { /** 是否开启多标签页拖拽 */ - dragable: boolean; + draggable: boolean; /** 是否开启多标签页 */ enable: boolean; /** 标签页高度 */ diff --git a/packages/@core/preferences/__tests__/__snapshots__/config.test.ts.snap b/packages/@core/preferences/__tests__/__snapshots__/config.test.ts.snap index 1f860f35..b6bf7b16 100644 --- a/packages/@core/preferences/__tests__/__snapshots__/config.test.ts.snap +++ b/packages/@core/preferences/__tests__/__snapshots__/config.test.ts.snap @@ -73,7 +73,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj "width": 224, }, "tabbar": { - "dragable": true, + "draggable": true, "enable": true, "height": 38, "keepAlive": true, diff --git a/packages/@core/preferences/src/config.ts b/packages/@core/preferences/src/config.ts index 8d026faa..6da8eda1 100644 --- a/packages/@core/preferences/src/config.ts +++ b/packages/@core/preferences/src/config.ts @@ -73,7 +73,7 @@ const defaultPreferences: Preferences = { width: 224, }, tabbar: { - dragable: true, + draggable: true, enable: true, height: 38, keepAlive: true, diff --git a/packages/@core/preferences/src/types.ts b/packages/@core/preferences/src/types.ts index 59341af2..45bde56f 100644 --- a/packages/@core/preferences/src/types.ts +++ b/packages/@core/preferences/src/types.ts @@ -154,7 +154,7 @@ interface ShortcutKeyPreferences { interface TabbarPreferences { /** 是否开启多标签页拖拽 */ - dragable: boolean; + draggable: boolean; /** 是否开启多标签页 */ enable: boolean; /** 标签页高度 */ diff --git a/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue b/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue index 86d1955b..f64e13d8 100644 --- a/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue +++ b/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue @@ -69,7 +69,7 @@ const tabsView = computed((): TabConfig[] => { v-for="(tab, i) in tabsView" :key="tab.key" ref="tabRef" - :class="[{ 'is-active': tab.key === active, dragable: !tab.affixTab }]" + :class="[{ 'is-active': tab.key === active, draggable: !tab.affixTab }]" :data-active-tab="active" :data-index="i" class="tabs-chrome__item draggable translate-all group relative -mr-3 flex h-full select-none items-center" diff --git a/packages/@core/ui-kit/tabs-ui/src/components/tabs/tabs.vue b/packages/@core/ui-kit/tabs-ui/src/components/tabs/tabs.vue index 96326e8d..67480f56 100644 --- a/packages/@core/ui-kit/tabs-ui/src/components/tabs/tabs.vue +++ b/packages/@core/ui-kit/tabs-ui/src/components/tabs/tabs.vue @@ -75,7 +75,7 @@ const tabsView = computed((): TabConfig[] => { :class="[ { 'is-active dark:bg-accent bg-primary/15': tab.key === active, - dragable: !tab.affixTab, + draggable: !tab.affixTab, }, typeWithClass.content, ]" diff --git a/packages/@core/ui-kit/tabs-ui/src/tabs-view.vue b/packages/@core/ui-kit/tabs-ui/src/tabs-view.vue index 1040a548..7656e489 100644 --- a/packages/@core/ui-kit/tabs-ui/src/tabs-view.vue +++ b/packages/@core/ui-kit/tabs-ui/src/tabs-view.vue @@ -17,7 +17,7 @@ defineOptions({ const props = withDefaults(defineProps(), { contentClass: 'vben-tabs-content', - dragable: true, + draggable: true, styleType: 'chrome', }); diff --git a/packages/@core/ui-kit/tabs-ui/src/types.ts b/packages/@core/ui-kit/tabs-ui/src/types.ts index 670d17bc..ce0ac474 100644 --- a/packages/@core/ui-kit/tabs-ui/src/types.ts +++ b/packages/@core/ui-kit/tabs-ui/src/types.ts @@ -21,7 +21,7 @@ export interface TabsProps { /** * @zh_CN 是否可以拖拽 */ - dragable?: boolean; + draggable?: boolean; /** * @zh_CN 间隙 * @default 7 diff --git a/packages/@core/ui-kit/tabs-ui/src/use-tabs-drag.ts b/packages/@core/ui-kit/tabs-ui/src/use-tabs-drag.ts index acefbfea..f76becaf 100644 --- a/packages/@core/ui-kit/tabs-ui/src/use-tabs-drag.ts +++ b/packages/@core/ui-kit/tabs-ui/src/use-tabs-drag.ts @@ -42,8 +42,8 @@ export function useTabsDrag(props: TabsProps, emit: EmitType) { const { initializeSortable } = useSortable(el, { filter: (_evt, target: HTMLElement) => { const parent = findParentElement(target); - const dragable = parent?.classList.contains('dragable'); - return !dragable || !props.dragable; + const draggable = parent?.classList.contains('draggable'); + return !draggable || !props.draggable; }, onEnd(evt) { const { newIndex, oldIndex } = evt; @@ -62,7 +62,7 @@ export function useTabsDrag(props: TabsProps, emit: EmitType) { return; } - if (!srcParent.classList.contains('dragable')) { + if (!srcParent.classList.contains('draggable')) { resetElState(); return; @@ -81,7 +81,7 @@ export function useTabsDrag(props: TabsProps, emit: EmitType) { }, onMove(evt) { const parent = findParentElement(evt.related); - return parent?.classList.contains('dragable') && props.dragable; + return parent?.classList.contains('draggable') && props.draggable; }, onStart: () => { el.style.cursor = 'grabbing'; diff --git a/packages/effects/layouts/src/basic/tabbar/tabbar.vue b/packages/effects/layouts/src/basic/tabbar/tabbar.vue index 2897cf6a..f932364e 100644 --- a/packages/effects/layouts/src/basic/tabbar/tabbar.vue +++ b/packages/effects/layouts/src/basic/tabbar/tabbar.vue @@ -51,7 +51,7 @@ if (!preferences.tabbar.persist) { :active="currentActive" :class="theme" :context-menus="createContextMenus" - :dragable="preferences.tabbar.dragable" + :draggable="preferences.tabbar.draggable" :show-icon="showIcon" :style-type="preferences.tabbar.styleType" :tabs="currentTabs" diff --git a/packages/effects/layouts/src/widgets/preferences/blocks/layout/tabbar.vue b/packages/effects/layouts/src/widgets/preferences/blocks/layout/tabbar.vue index ef2245bd..5a3824a6 100644 --- a/packages/effects/layouts/src/widgets/preferences/blocks/layout/tabbar.vue +++ b/packages/effects/layouts/src/widgets/preferences/blocks/layout/tabbar.vue @@ -17,7 +17,7 @@ defineProps<{ disabled?: boolean }>(); const tabbarEnable = defineModel('tabbarEnable'); const tabbarShowIcon = defineModel('tabbarShowIcon'); const tabbarPersist = defineModel('tabbarPersist'); -const tabbarDragable = defineModel('tabbarDragable'); +const tabbarDraggable = defineModel('tabbarDraggable'); const tabbarStyleType = defineModel('tabbarStyleType'); const tabbarShowMore = defineModel('tabbarShowMore'); const tabbarShowMaximize = defineModel('tabbarShowMaximize'); @@ -50,8 +50,8 @@ const styleItems = computed((): SelectOption[] => [ {{ $t('preferences.tabbar.persist') }} - - {{ $t('preferences.tabbar.dragable') }} + + {{ $t('preferences.tabbar.draggable') }} {{ $t('preferences.tabbar.icon') }} diff --git a/packages/effects/layouts/src/widgets/preferences/preferences-drawer.vue b/packages/effects/layouts/src/widgets/preferences/preferences-drawer.vue index 60cca274..ab713a7b 100644 --- a/packages/effects/layouts/src/widgets/preferences/preferences-drawer.vue +++ b/packages/effects/layouts/src/widgets/preferences/preferences-drawer.vue @@ -102,7 +102,7 @@ const tabbarShowIcon = defineModel('tabbarShowIcon'); const tabbarShowMore = defineModel('tabbarShowMore'); const tabbarShowMaximize = defineModel('tabbarShowMaximize'); const tabbarPersist = defineModel('tabbarPersist'); -const tabbarDragable = defineModel('tabbarDragable'); +const tabbarDraggable = defineModel('tabbarDraggable'); const tabbarStyleType = defineModel('tabbarStyleType'); const navigationStyleType = defineModel( @@ -339,7 +339,7 @@ async function handleReset() {