1
0
mirror of https://github.com/WeBankFinTech/fes.js.git synced 2025-04-06 03:59:53 +08:00
This commit is contained in:
bac-joker 2020-12-22 19:39:09 +08:00
commit d2b91cce94
4 changed files with 7 additions and 11 deletions
packages
fes-plugin-locale
fes-plugin-model/src/models
fes-template/src/components

@ -4,6 +4,9 @@ import { createI18n, useI18n } from 'vue-i18n';
// 动态变更 local
// 其他组件能拿到 t 函数
// local 变更后,能通知到其他函数
// locales目录下以语言简称为子文件下存放配置信息
// 其他插件可以运行时修改配置
// 所有插件使用一个语言和配置
export default {
install(app, options, ctx) {

@ -10,6 +10,6 @@
"author": "",
"license": "MIT",
"dependencies": {
"vue-i18n": "^9.0.0-beta.2"
"vue-i18n": "^9.0.0-beta.15"
}
}

@ -1,12 +1,5 @@
import { reactive, toRefs, inject } from "vue";
import { inject, reactive } from "vue";
export default function initalModel() {
const initialState = reactive(inject("initialState"));
const setInitialState = (obj) => {
initState = reactive(obj);
};
return toRefs({
initialState,
setInitialState
});
return reactive(inject("initialState"));
}

@ -6,7 +6,7 @@ import { useModel } from '@webank/fes';
export default {
setup() {
const { initialState } = useModel('@@initialState');
const initialState = useModel('@@initialState');
return {
initialState
};