Browse Source

修复了addCluster(‘otherLayer’)的BUG

napier 3 years ago
parent
commit
cda4de9933
4 changed files with 7 additions and 7 deletions
  1. 1 1
      build/utils.js
  2. 3 3
      src/components/card.vue
  3. 1 1
      src/components/map.vue
  4. 2 2
      static/js/axios-config.js

+ 1 - 1
build/utils.js

@@ -48,7 +48,7 @@ exports.cssLoaders = function (options) {
       return ExtractTextPlugin.extract({
         use: loaders,
         fallback: 'vue-style-loader',
-		publicPath: '../../' // 解决element UI打包后字体文件丢失
+		    publicPath: '../../' // 解决element UI打包后字体文件丢失
       })
     } else {
       return ['vue-style-loader'].concat(loaders)

+ 3 - 3
src/components/card.vue

@@ -55,7 +55,7 @@ export default {
     // 图片链接
     img: {
       type: String,
-      default: '../../static/img/card-img.png'
+      default: 'https://i.loli.net/2021/09/26/SAI1gWCvB8DMsTi.png'
     }
   },
   name: 'phoneCard',
@@ -63,7 +63,7 @@ export default {
     return {
       button: '',
       flag: '',
-      imgArr: ['../../static/img/card-img.png'],
+      imgArr: ['https://i.loli.net/2021/09/26/SAI1gWCvB8DMsTi.png'],
       showMore: false,
       screenSize: window.screen.width
     }
@@ -172,7 +172,7 @@ export default {
       if (val !== null && val !== '') {
         this.imgArr = [val]
       } else {
-        this.imgArr = ['../../static/img/card-img.png']
+        this.imgArr = ['https://i.loli.net/2021/09/26/SAI1gWCvB8DMsTi.png']
       }
     }
   },

+ 1 - 1
src/components/map.vue

@@ -659,7 +659,7 @@ export default {
           res.data.forEach(e => {
             that.printFeature('otherLayer', e, 'other')
           })
-          this.addCluster('otherLayer', this.moreStyles.Point)
+          this.addCluster('otherLayer', this.otherStyles.Point)
         })
     },
 

+ 2 - 2
static/js/axios-config.js

@@ -8,8 +8,8 @@
 export default {
   install (Vue) {
     // 请求前缀
-    Vue.prototype.$axios.defaults.baseURL = 'http://127.0.0.1:300'
-    // Vue.prototype.$axios.defaults.baseURL = 'http://42.193.189.65:300'
+    // Vue.prototype.$axios.defaults.baseURL = 'http://127.0.0.1:300'
+    Vue.prototype.$axios.defaults.baseURL = 'http://42.193.189.65:300'
     // 设置超时时间
     Vue.prototype.$axios.defaults.timeout = 10000
     // 请求封装