This commit is contained in:
kakkokari-gtyih 2025-10-05 17:27:25 +09:00
parent ee4f203e0b
commit 7b1a4edf64
1 changed files with 6 additions and 5 deletions

View File

@ -56,6 +56,8 @@ export type Tab<K = string> = {
import { nextTick, onMounted, onUnmounted, useTemplateRef, watch } from 'vue';
import { prefer } from '@/preferences.js';
const cssAnchorSupported = CSS.supports('position-anchor', '--anchor-name');
const props = withDefaults(defineProps<{
tabs?: T[];
centered?: boolean;
@ -65,7 +67,6 @@ const props = withDefaults(defineProps<{
});
const emit = defineEmits<{
(ev: 'update:tab', key: string);
(ev: 'tabClick', key: string);
}>();
@ -74,10 +75,10 @@ const tab = defineModel<T['key']>('tab');
const tabHighlightEl = useTemplateRef('tabHighlightEl');
const tabRefs: Record<string, HTMLElement | null> = {};
function onTabMousedown(tab: Tab, ev: MouseEvent): void {
function onTabMousedown(selectedTab: Tab, ev: MouseEvent): void {
// mousedownonClick
if (tab.key) {
emit('update:tab', tab.key);
if (selectedTab.key) {
tab.value = selectedTab.key;
}
}
@ -91,7 +92,7 @@ function onTabClick(t: Tab, ev: MouseEvent): void {
}
if (t.key) {
emit('update:tab', t.key);
tab.value = t.key;
}
}