first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:10:55 +08:00
commit 1c24452b6c
1735 changed files with 150474 additions and 0 deletions

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["uni_modules/wot-design-uni/locale/index.ts"],"sourcesContent":["/*\n * @Author: weisheng\n * @Date: 2024-01-25 23:06:48\n * @LastEditTime: 2024-03-30 11:30:55\n * @LastEditors: weisheng\n * @Description:\n * @FilePath: /wot-design-uni/src/uni_modules/wot-design-uni/locale/index.ts\n * 记得注释\n */\nimport { reactive, ref } from 'vue'\nimport zhCN from './lang/zh-CN'\nimport { deepAssign } from '../components/common/util'\n\ntype Message = Record<string, any>\ntype Messages = Record<string, Message>\n\nconst lang = ref<string>('zh-CN')\nconst messages = reactive<Messages>({\n 'zh-CN': zhCN\n})\n\nexport const Locale = {\n messages(): Message {\n return messages[lang.value]\n },\n\n use(newLang: string, newMessage?: Message) {\n lang.value = newLang\n if (newMessage) {\n this.add({ [newLang]: newMessage })\n }\n },\n\n add(newMessages: Messages = {}) {\n deepAssign(messages, newMessages)\n }\n}\n\nexport const useCurrentLang = () => lang\n\nexport default Locale\n"],"names":["ref","reactive","zhCN","deepAssign"],"mappings":";;;;AAgBA,MAAM,OAAOA,cAAAA,IAAY,OAAO;AAChC,MAAM,WAAWC,cAAAA,SAAmB;AAAA,EAClC,SAASC,0CAAA;AACX,CAAC;AAEM,MAAM,SAAS;AAAA,EACpB,WAAoB;AACX,WAAA,SAAS,KAAK,KAAK;AAAA,EAC5B;AAAA,EAEA,IAAI,SAAiB,YAAsB;AACzC,SAAK,QAAQ;AACb,QAAI,YAAY;AACd,WAAK,IAAI,EAAE,CAAC,OAAO,GAAG,WAAY,CAAA;AAAA,IACpC;AAAA,EACF;AAAA,EAEA,IAAI,cAAwB,IAAI;AAC9BC,+DAAW,UAAU,WAAW;AAAA,EAClC;AACF;;"}

File diff suppressed because one or more lines are too long