rayyy-vue-table-components 2.0.17 → 2.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rayyy-vue-table-components",
3
- "version": "2.0.17",
3
+ "version": "2.0.18",
4
4
  "description": "Vue 3 + Element Plus 表格組件庫",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",
@@ -4,7 +4,6 @@ import type { Pager } from '@/types'
4
4
  import { MainPanel, SearchBar } from '@/components'
5
5
  import { useComponentElementLocale } from '@/utils/i18n'
6
6
  import type { Language } from 'element-plus/es/locale'
7
- import zhTw from 'element-plus/es/locale/lang/zh-tw'
8
7
 
9
8
  const props = withDefaults(
10
9
  defineProps<{
@@ -56,14 +55,17 @@ const showPager = computed(() => {
56
55
  }
57
56
  })
58
57
 
58
+ // 在 computed 外部調用,保持引用穩定
59
+ const fallbackLocale = useComponentElementLocale()
60
+
59
61
  // 優先使用 prop,沒有 prop 則使用 composable
60
62
  const elementLocale = computed(() => {
61
63
  // 檢查 props.locale 是否為真正的 Language 對象(不是預設值)
62
64
  if (props.locale && typeof props.locale === 'object' && 'name' in props.locale) {
63
65
  return props.locale
64
66
  }
65
- // 回退:使用簡化的 composable
66
- return useComponentElementLocale().value
67
+ // 現在能正確追蹤響應式
68
+ return fallbackLocale.value
67
69
  })
68
70
  </script>
69
71