Authored by wangtao

fix: 加载皮肤文件

const ver = window.__ver || '';
import global from "./script/global.js";
Promise.all([
import('./store/index.js' + ver),
import('./router/index.js' + ver),
... ... @@ -7,6 +9,11 @@ Promise.all([
import('./script/global.js' + ver),
import('./script/http.js' + ver),
]).then((res) => {
// 加载皮肤信息
let theme = global.getQueryVariable("theme");
global.loadTheme(theme);
// element plus 切换语言
// https://element-plus.org/zh-CN/guide/i18n.html#configprovider
// 创建vue3的实例
... ...
... ... @@ -32,6 +32,25 @@ global.common = {
};
/**
* 加载样式
* @param href
*/
global.loadTheme = (theme) => {
try {
if (!theme) {
theme = 'simplicity';
}
var link = document.createElement("link");
link.setAttribute("rel", "stylesheet");
link.setAttribute("type", "text/css");
link.setAttribute("href", `/mj/public/css/sub-sys/monitor-vue-${theme}.css`);
document.body.insertBefore(link, document.body.firstChild);
} catch (e) {
}
}
global.message = {
types: {
// 数据重复添加
... ...