From 53f6771d69147873764a4cd3619bf5c6bb20d4a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=99=8C?= Date: Sun, 11 Jun 2023 22:58:26 +0800 Subject: [PATCH] config --- src/App.vue | 2 +- src/config/myConfig.js | 4 ++-- src/layout/components/setting.vue | 4 ++-- src/layout/components/tags.vue | 2 +- src/scui.js | 2 +- src/views/home/widgets/index.vue | 2 +- src/views/login/index.vue | 2 +- src/views/userCenter/user/seting.vue | 4 ++-- src/views/vab/form.vue | 4 ++-- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/App.vue b/src/App.vue index 5934488..d439861 100644 --- a/src/App.vue +++ b/src/App.vue @@ -28,7 +28,7 @@ created() { //设置主题颜色 - const app_color = this.$CONFIG.COLOR || this.$tool.data.get('APP_COLOR') + const app_color = this.$config.COLOR || this.$tool.data.get('APP_COLOR') if(app_color){ document.documentElement.style.setProperty('--el-color-primary', app_color); for (let i = 1; i <= 9; i++) { diff --git a/src/config/myConfig.js b/src/config/myConfig.js index e87699d..4c33e9d 100644 --- a/src/config/myConfig.js +++ b/src/config/myConfig.js @@ -1,8 +1,8 @@ //业务配置 -//会合并至this.$CONFIG +//会合并至this.$config //生产模式 public/config.js 同名key会覆盖这里的配置从而实现打包后的热更新 //为避免和SCUI框架配置混淆建议添加前缀 MY_ -//全局可使用 this.$CONFIG.MY_KEY 访问 +//全局可使用 this.$config.MY_KEY 访问 export default { //是否显示第三方授权登录 diff --git a/src/layout/components/setting.vue b/src/layout/components/setting.vue index ec5d11f..0849589 100644 --- a/src/layout/components/setting.vue +++ b/src/layout/components/setting.vue @@ -41,10 +41,10 @@ layout: this.$store.state.global.layout, menuIsCollapse: this.$store.state.global.menuIsCollapse, layoutTags: this.$store.state.global.layoutTags, - lang: this.$tool.data.get('APP_LANG') || this.$CONFIG.LANG, + lang: this.$tool.data.get('APP_LANG') || this.$config.LANG, dark: this.$tool.data.get('APP_DARK') || false, colorList: ['#409EFF', '#009688', '#536dfe', '#ff5c93', '#c62f2f', '#fd726d'], - colorPrimary: this.$tool.data.get('APP_COLOR') || this.$CONFIG.COLOR || '#409EFF' + colorPrimary: this.$tool.data.get('APP_COLOR') || this.$config.COLOR || '#409EFF' } }, watch: { diff --git a/src/layout/components/tags.vue b/src/layout/components/tags.vue index ae23c70..0187761 100644 --- a/src/layout/components/tags.vue +++ b/src/layout/components/tags.vue @@ -80,7 +80,7 @@ }, created() { var menu = this.$router.sc_getMenu() - var dashboardRoute = this.treeFind(menu, node => node.path==this.$CONFIG.DASHBOARD_URL) + var dashboardRoute = this.treeFind(menu, node => node.path==this.$config.DASHBOARD_URL) if(dashboardRoute){ dashboardRoute.fullPath = dashboardRoute.path this.addViewTags(dashboardRoute) diff --git a/src/scui.js b/src/scui.js index 921e6f6..e38647e 100644 --- a/src/scui.js +++ b/src/scui.js @@ -37,7 +37,7 @@ import * as scIcons from './assets/icons' export default { install(app) { //挂载全局对象 - app.config.globalProperties.$CONFIG = config; + app.config.globalProperties.$config = config; app.config.globalProperties.$tool = tool; app.config.globalProperties.$http = http; app.config.globalProperties.$api = api; diff --git a/src/views/home/widgets/index.vue b/src/views/home/widgets/index.vue index ef490d9..2a0431c 100644 --- a/src/views/home/widgets/index.vue +++ b/src/views/home/widgets/index.vue @@ -102,7 +102,7 @@ customizing: false, allComps: allComps, selectLayout: [], - defaultGrid: this.$CONFIG.DEFAULT_GRID, + defaultGrid: this.$config.DEFAULT_GRID, grid: [] } }, diff --git a/src/views/login/index.vue b/src/views/login/index.vue index bbad696..e2e15eb 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -72,7 +72,7 @@ data() { return { config: { - lang: this.$tool.data.get('APP_LANG') || this.$CONFIG.LANG, + lang: this.$tool.data.get('APP_LANG') || this.$config.LANG, dark: this.$tool.data.get('APP_DARK') || false }, lang: [ diff --git a/src/views/userCenter/user/seting.vue b/src/views/userCenter/user/seting.vue index 7a893e9..9121837 100644 --- a/src/views/userCenter/user/seting.vue +++ b/src/views/userCenter/user/seting.vue @@ -50,9 +50,9 @@ return { colorList: ['#409EFF', '#009688', '#536dfe', '#ff5c93', '#c62f2f', '#fd726d'], config: { - lang: this.$tool.data.get('APP_LANG') || this.$CONFIG.LANG, + lang: this.$tool.data.get('APP_LANG') || this.$config.LANG, dark: this.$tool.data.get('APP_DARK') || false, - colorPrimary: this.$tool.data.get('APP_COLOR') || this.$CONFIG.COLOR || '#409EFF', + colorPrimary: this.$tool.data.get('APP_COLOR') || this.$config.COLOR || '#409EFF', autoExit: this.$tool.data.get('AUTO_EXIT') || 0, } } diff --git a/src/views/vab/form.vue b/src/views/vab/form.vue index 0864fb9..7814de4 100644 --- a/src/views/vab/form.vue +++ b/src/views/vab/form.vue @@ -95,7 +95,7 @@ span: 24, options: { remote: { - api: `${this.$CONFIG.API_URL}/system/dic/get`, + api: `${this.$config.API_URL}/system/dic/get`, data: {name: 'a'} }, multiple: true, @@ -123,7 +123,7 @@ span: 24, options: { remote: { - api: `${this.$CONFIG.API_URL}/system/dic/get`, + api: `${this.$config.API_URL}/system/dic/get`, data: {name: 'b'} }, items:[