rayyy-vue-table-components 1.3.17 → 1.3.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/README.md CHANGED
@@ -38,6 +38,8 @@ pnpm add rayyy-vue-table-components
38
38
  ```
39
39
 
40
40
  > **注意**: 本組件庫需要 Vue 3.0+ 和 Element Plus 作為對等依賴。
41
+ >
42
+ > **重要**: 請確保在外部專案中正確配置 Element Plus 的語言設定,組件庫內部不會自動設定語言。
41
43
 
42
44
  ## 🚀 快速開始
43
45
 
@@ -48,6 +50,7 @@ pnpm add rayyy-vue-table-components
48
50
  ```typescript
49
51
  import { createApp } from 'vue'
50
52
  import ElementPlus from 'element-plus'
53
+ import { getElementPlusConfig } from 'rayyy-vue-table-components'
51
54
  import 'element-plus/dist/index.css'
52
55
  import VueTableComponents from 'rayyy-vue-table-components'
53
56
  import 'rayyy-vue-table-components/styles'
@@ -56,10 +59,8 @@ import App from './App.vue'
56
59
 
57
60
  const app = createApp(App)
58
61
 
59
- // 安裝 Element Plus(可自定義語系)
60
- app.use(ElementPlus, {
61
- locale: zhTw // 設定繁體中文
62
- })
62
+ // 安裝 Element Plus(使用組件庫提供的語言配置)
63
+ app.use(ElementPlus, getElementPlusConfig('zh-tw'))
63
64
 
64
65
  // 安裝組件庫
65
66
  app.use(VueTableComponents)
@@ -69,26 +70,23 @@ app.mount('#app')
69
70
 
70
71
  ### 語系設定
71
72
 
72
- 組件庫依賴 Element Plus,請在安裝 Element Plus 時設定語系:
73
+ **重要**: 組件庫依賴 Element Plus,請務必在外部專案中正確配置 Element Plus 的語言設定。組件庫內部不會自動設定語言,需要在外部專案中手動配置:
73
74
 
74
75
  ```typescript
75
76
  import { createApp } from 'vue'
76
77
  import ElementPlus from 'element-plus'
77
- import zhTw from 'element-plus/es/locale/lang/zh-tw'
78
- import en from 'element-plus/es/locale/lang/en'
78
+ import { getElementPlusConfig, zhTw, en } from 'rayyy-vue-table-components'
79
79
  import VueTableComponents from 'rayyy-vue-table-components'
80
80
 
81
81
  const app = createApp(App)
82
82
 
83
- // 使用繁體中文
84
- app.use(ElementPlus, {
85
- locale: zhTw
86
- })
83
+ // 方法一:使用組件庫提供的配置函數(推薦)
84
+ app.use(ElementPlus, getElementPlusConfig('zh-tw')) // 繁體中文
85
+ // app.use(ElementPlus, getElementPlusConfig('en')) // 英文
87
86
 
88
- // 或使用英文
89
- app.use(ElementPlus, {
90
- locale: en
91
- })
87
+ // 方法二:直接使用語言包
88
+ // app.use(ElementPlus, { locale: zhTw }) // 繁體中文
89
+ // app.use(ElementPlus, { locale: en }) // 英文
92
90
 
93
91
  app.use(VueTableComponents)
94
92
  app.mount('#app')