Browse Source

fix: 饼图深度监听

Cooklalala 5 months ago
parent
commit
0493e37da2

+ 0 - 1
mm/mm.config.js

@@ -58,7 +58,6 @@ module.exports = async (util) => {
               `https://geo.datav.aliyun.com/areas_v3/bound/geojson?code=520600_full`
             )
             .then((res) => res.data)
-          console.log(`data`, data)
           res.json(
             wrapApiData(
               util.libObj.mockjs.mock({

+ 6 - 5
src/components/Customize/cake.vue

@@ -50,9 +50,6 @@ export default {
       type: String,
       default: ``,
     },
-    key: {
-      type: Object,
-    },
     titleEn: {
       type: String,
       default: `Tongren Tobacco Planting Digital Management Platform`,
@@ -62,8 +59,12 @@ export default {
     this.getEchart()
   },
   watch: {
-    data() {
-      this.getEchart()
+    data: {
+      handler(newVal) {
+        this.getEchart()
+      },
+      deep: true, // 深度监听
+      immediate: true, // 立即执行
     },
   },
   methods: {

+ 0 - 1
src/components/Customize/cylindricalHistogram.vue

@@ -73,7 +73,6 @@ export default {
             },
           },
           formatter: function (params) {
-            console.log(params, `111111`)
             return [params[0].value].join(`<br>`)
           },
         },

+ 3 - 2
src/views/page1/index.vue

@@ -319,8 +319,9 @@ export default {
     },
     async getJSON() {
       console.log(`获取JSOn`)
-      this.getJson = await this.$http.get(`/api/mapOfTongren`)
-      console.log(this.getJson)
+      this.getJson = await this.$http.get(
+        `/datav/areas_v3/bound/geojson?code=520600_full`
+      )
       this.hasGetJson = true
     },
   },