mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-07 00:47:19 +08:00
perf: wangeditor
This commit is contained in:
parent
294e4f6601
commit
0d694e9870
@ -25,13 +25,17 @@ const {
|
||||
pureApp,
|
||||
username,
|
||||
avatarsStyle,
|
||||
getDropdownItemStyle
|
||||
getDropdownItemStyle,
|
||||
changeWangeditorLanguage
|
||||
} = useNav();
|
||||
|
||||
watch(
|
||||
() => locale.value,
|
||||
() => {
|
||||
changeTitle(route.meta);
|
||||
locale.value === "en"
|
||||
? changeWangeditorLanguage(locale.value)
|
||||
: changeWangeditorLanguage("zh-CN");
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -186,6 +186,8 @@ function setFalse(Doms): any {
|
||||
}
|
||||
|
||||
watch(instance, ({ layout }) => {
|
||||
// 设置wangeditorV5主题色
|
||||
body.style.setProperty("--w-e-toolbar-active-color", layout["epThemeColor"]);
|
||||
switch (layout["layout"]) {
|
||||
case "vertical":
|
||||
toggleClass(true, isSelect, unref(verticalRef));
|
||||
|
@ -31,7 +31,8 @@ const {
|
||||
menuSelect,
|
||||
username,
|
||||
avatarsStyle,
|
||||
getDropdownItemStyle
|
||||
getDropdownItemStyle,
|
||||
changeWangeditorLanguage
|
||||
} = useNav();
|
||||
|
||||
onMounted(() => {
|
||||
@ -44,6 +45,9 @@ watch(
|
||||
() => locale.value,
|
||||
() => {
|
||||
changeTitle(route.meta);
|
||||
locale.value === "en"
|
||||
? changeWangeditorLanguage(locale.value)
|
||||
: changeWangeditorLanguage("zh-CN");
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -34,7 +34,8 @@ const {
|
||||
pureApp,
|
||||
username,
|
||||
avatarsStyle,
|
||||
getDropdownItemStyle
|
||||
getDropdownItemStyle,
|
||||
changeWangeditorLanguage
|
||||
} = useNav();
|
||||
|
||||
let defaultActive = ref(null);
|
||||
@ -60,6 +61,9 @@ watch(
|
||||
() => locale.value,
|
||||
() => {
|
||||
changeTitle(route.meta);
|
||||
locale.value === "en"
|
||||
? changeWangeditorLanguage(locale.value)
|
||||
: changeWangeditorLanguage("zh-CN");
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -7,6 +7,7 @@ import { remainingPaths } from "/@/router";
|
||||
import { transformI18n } from "/@/plugins/i18n";
|
||||
import { storageSession } from "/@/utils/storage";
|
||||
import { useAppStoreHook } from "/@/store/modules/app";
|
||||
import { i18nChangeLanguage } from "@wangeditor/editor";
|
||||
import { useEpThemeStoreHook } from "/@/store/modules/epTheme";
|
||||
|
||||
const errorInfo = "当前路由配置不正确,请检查配置";
|
||||
@ -109,6 +110,15 @@ export function useNav() {
|
||||
return remainingPaths.includes(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换wangEditorV5国际化
|
||||
* @param language string 可选值 en、zh-CN
|
||||
* @returns void
|
||||
*/
|
||||
function changeWangeditorLanguage(language: string): void {
|
||||
i18nChangeLanguage(language);
|
||||
}
|
||||
|
||||
return {
|
||||
logout,
|
||||
backHome,
|
||||
@ -122,6 +132,7 @@ export function useNav() {
|
||||
pureApp,
|
||||
username,
|
||||
avatarsStyle,
|
||||
getDropdownItemStyle
|
||||
getDropdownItemStyle,
|
||||
changeWangeditorLanguage
|
||||
};
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ onMounted(() => {
|
||||
}, 1500);
|
||||
});
|
||||
|
||||
const toolbarConfig = {};
|
||||
const toolbarConfig = { excludeKeys: "fullScreen" };
|
||||
const editorConfig = { placeholder: "请输入内容..." };
|
||||
|
||||
// 组件销毁时,也及时销毁编辑器
|
||||
|
Loading…
x
Reference in New Issue
Block a user