From d6e7f8eeda264d9fa2c1be6dab71780b5d550273 Mon Sep 17 00:00:00 2001
From: YANGDL <114714267@qq.com>
Date: 星期日, 14 三月 2021 10:49:42 +0800
Subject: [PATCH] 样式修改为全局

---
 vue.config.js                        |   10 +++++++++-
 src/main.js                          |    2 +-
 package.json                         |    2 ++
 src/components/panel/LegendPanel.vue |    1 -
 4 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/package.json b/package.json
index 1e6e4b7..1004223 100644
--- a/package.json
+++ b/package.json
@@ -30,7 +30,9 @@
     "nprogress": "^0.2.0",
     "rbush": "^3.0.1",
     "screenfull": "^3.3.3",
+    "style-resources-loader": "^1.4.1",
     "vue": "^2.6.11",
+    "vue-cli-plugin-style-resources-loader": "^0.1.4",
     "vue-count-to": "^1.0.13",
     "vue-focus": "^2.1.0",
     "vue-fullscreen": "^2.2.0",
diff --git a/src/components/panel/LegendPanel.vue b/src/components/panel/LegendPanel.vue
index f7329bc..383aea2 100644
--- a/src/components/panel/LegendPanel.vue
+++ b/src/components/panel/LegendPanel.vue
@@ -145,7 +145,6 @@
 </script>
 
 <style lang="less">
-@import '@assets/css/map/_map-variable';
 .legend-panel {
   position: absolute;
   z-index: 502;
diff --git a/src/main.js b/src/main.js
index 5f7bf42..8ca4020 100644
--- a/src/main.js
+++ b/src/main.js
@@ -8,7 +8,7 @@
 import echartsDarkTheme from '@/styles/theme-dark/echarts/theme.json'
 import ElementUI from 'element-ui'
 import 'element-ui/lib/theme-chalk/index.css'
-import './assets/css/map/_map-variable.less'
+import '@assets/css/map/_map-variable.less'
 import '@assets/css/map/map-panel-style.less'
 import 'leaflet/dist/leaflet.css'
 import L from 'leaflet'
diff --git a/vue.config.js b/vue.config.js
index be07b5a..07df932 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,5 +1,5 @@
 const appConfig = require('./src/app.config')
-
+const path = require('path')
 module.exports = {
   publicPath: process.env.NODE_ENV === 'production' ? `/${appConfig.projectName}/` : '/',
   configureWebpack: config => {
@@ -16,6 +16,14 @@
   },
   parallel: require('os').cpus().length > 1, // 鏋勫缓鏃跺紑鍚杩涚▼澶勭悊babel缂栬瘧
   productionSourceMap: false,
+  pluginOptions: {
+    'style-resources-loader': {
+      preProcessor: 'less',
+      patterns: [
+        path.resolve(__dirname, './src/assets/css/map/_map-variable.less')
+      ]
+    }
+  },
   devServer: {
     // host: 'localhost',
     // open: true,

--
Gitblit v1.8.0