feat(下划线元素): 位置根据语言切换重新计算

This commit is contained in:
hzj 2025-12-15 14:42:17 +08:00
parent 75163ce927
commit ca1feeebe1
2 changed files with 8 additions and 0 deletions

View File

@ -202,6 +202,10 @@ const setActiveTab = (index) => {
const underlineStyle = computed(() => {
console.log('计算属性')
// 访 locale.value 使
const currentLocale = locale.value
console.log('当前语言:', currentLocale)
if (tabItems.value.length === 0) return {} //
const activeTab = tabItems.value[activeIndex.value]
console.log('选中元素的左边距', activeTab.offsetLeft)

View File

@ -314,6 +314,10 @@ const switchTab = async (tab) => {
const underlineStyle = computed(() => {
console.log('计算属性')
// 访 locale.value 使
const currentLocale = locale.value
console.log('当前语言:', currentLocale)
if (tabItems.value.length === 0) return {} //
const activeTab = tabItems.value[selectedTab.value.id]
console.log('选中元素的左边距', activeTab.offsetLeft)