File tree Expand file tree Collapse file tree 6 files changed +3142
-1
lines changed
view/systemTools/formCreate Expand file tree Collapse file tree 6 files changed +3142
-1
lines changed Original file line number Diff line number Diff line change 1010import zh from ' element-plus/dist/locale/zh-cn.mjs'
1111import en from ' element-plus/dist/locale/en.mjs'
1212import ar from ' element-plus/dist/locale/ar.mjs'
13+ import zh_tw from ' element-plus/dist/locale/zh-tw.mjs'
1314import {useAppStore } from " @/pinia" ;
1415import { useI18n } from ' vue-i18n'
1516
@@ -20,6 +21,7 @@ defineOptions({
2021
2122const languages = {
2223 ' zh-cn' : zh,
24+ ' zh-TW' : zh_tw,
2325 ' en' : en,
2426 ' ar' : ar
2527}
Original file line number Diff line number Diff line change 11<template >
2- <fc-designer ref =" designer" :config =" config" height =" calc(100vh - 160px)" />
2+ <fc-designer ref =" designer" :config =" config" :locale = " languages[locale] " height =" calc(100vh - 160px)" />
33</template >
44
55<script setup>
66
77import {ref } from " vue" ;
8+
89import FcDesigner from ' @form-create/designer'
910
11+ import en from " ./locale/en.js" ; // 导入英文语言包
12+ import zh from " ./locale/zh_cn.js" ; // 导入中文语言包
13+ import zh_tw from " ./locale/zh_tw.js" ; // 导入中文语言包
14+ import ar from " ./locale/ar.js" ;
15+ import {useI18n } from " vue-i18n" ; // 导入中文语言包
16+
17+ const { locale } = useI18n ()
18+
19+ console .log (locale .value )
20+
1021defineOptions ({
1122 name: ' FormGenerator'
1223})
1324
25+ const languages = {
26+ ' zh-cn' : zh,
27+ ' zh-TW' : zh_tw,
28+ ' en' : en,
29+ ' ar' : ar
30+ }
31+
1432const designer = ref (null )
1533
1634const config = {
1735 fieldReadonly: false
1836}
1937
38+
2039 </script >
You can’t perform that action at this time.
0 commit comments