@xizs/nuxt-antui 0.0.12 → 0.0.14

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/app/app.vue ADDED
@@ -0,0 +1,17 @@
1
+ <template>
2
+ <NuxtLayout >
3
+ <NuxtLoadingIndicator color="blue" />
4
+ <a-config-provider componentSize="middle" :locale="useAntLocale">
5
+ <NuxtPage></NuxtPage>
6
+ </a-config-provider>
7
+ </NuxtLayout>
8
+ </template>
9
+
10
+ <script lang="ts" setup>
11
+
12
+ </script>
13
+
14
+ <style lang="scss">
15
+ </style>
16
+
17
+
@@ -1,5 +1,38 @@
1
- import zhCN from 'ant-design-vue/es/locale/zh_CN';
2
1
 
3
- export const useAntLocale = () => useState(() => {
4
- return zhCN
2
+ import zh_CN from 'ant-design-vue/es/locale/zh_CN';
3
+ import zh_TW from 'ant-design-vue/es/locale/zh_TW';
4
+ import en_US from 'ant-design-vue/es/locale/en_US';
5
+ import vi_VN from 'ant-design-vue/es/locale/vi_VN';
6
+ import id_ID from 'ant-design-vue/es/locale/id_ID';
7
+ import ms_MY from 'ant-design-vue/es/locale/ms_MY';
8
+
9
+ import dayjs from 'dayjs';
10
+ import 'dayjs/locale/en';
11
+ import 'dayjs/locale/zh-cn';
12
+ import 'dayjs/locale/zh-tw';
13
+ import 'dayjs/locale/vi';
14
+ import 'dayjs/locale/id';
15
+ import 'dayjs/locale/ms-my';
16
+
17
+ let antLocales:Record<string,any> = {
18
+ zh_CN,
19
+ zh_TW,
20
+ en_US,
21
+ vi_VN,
22
+ id_ID,
23
+ ms_MY,
24
+ }
25
+
26
+ export const useAntLocale = computed(()=>{
27
+ let locale = useNuxtApp().$i18n.locale
28
+ dayjs.locale({
29
+ 'zh_CN':'zh-cn',
30
+ 'zh_TW':'zh-tw',
31
+ 'en_US':'en',
32
+ 'vi_VN':'vi',
33
+ 'id_ID':'id',
34
+ 'ms_MY':'ms-my'
35
+ }[locale.value]);
36
+
37
+ return antLocales[locale.value]
5
38
  })
package/nuxt.config.ts CHANGED
@@ -19,7 +19,7 @@ export default defineNuxtConfig({
19
19
  plugins: [tailwindcss()],
20
20
  },
21
21
  i18n: {
22
- defaultLocale: 'zh',
22
+ defaultLocale: 'zh_CN',
23
23
  strategy: 'no_prefix',
24
24
  compilation: {
25
25
  strictMessage: false,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xizs/nuxt-antui",
3
3
  "type": "module",
4
- "version": "0.0.12",
4
+ "version": "0.0.14",
5
5
  "main": "./nuxt.config.ts",
6
6
  "scripts": {
7
7
  "dev": "nuxi dev .playground",