theme.js
590 Bytes
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-24 16:44:54
*/
import Vue from 'vue'
export default function getTheme (theme = Vue.prototype.BASE_API.THEME) {
const resultMap = {
'jg': function () {
return import("@/styles/jgPublic.scss");
},
'sb': function () {
return import("@/styles/sbPublic.scss");
},
'default': function () {
throw new Error(`Unsupported theme: ${theme}`);
},
};
const result = resultMap[theme]();
if (result instanceof Promise) {
return result;
} else {
return resultMap.default();
}
}