Browse Source

lineChart 方法修改

fanghuisheng 4 years ago
parent
commit
81d9175f8a
1 changed files with 10 additions and 9 deletions
  1. 10 9
      src/views/home/components/lineChart.vue

+ 10 - 9
src/views/home/components/lineChart.vue

@@ -5,11 +5,17 @@
 import * as echarts from "echarts";
 
 export default {
-  props: ["ftrendIcoCount"],
+  props: {
+    ftrendIcoCount: Object,
+  },
+  computed: {
+    ftrendIco() {
+      return this.ftrendIcoCount;
+    },
+  },
   data() {
     return {};
   },
-
   mounted() {
     this.$nextTick(() => {
       this.initChart();
@@ -20,13 +26,8 @@ export default {
     window.removeEventListener("resize", this.chart);
   },
   watch: {
-    'ftrendIcoCount': {
-      immediate: true, // 首次加载的时候执行函数
-      deep: true, // 深入观察,监听数组值,对象属性值的变化
-      handler: function () {
-        console.log("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
-        this.initChart();
-      },
+    ftrendIco() {
+      this.initChart();
     },
   },
   methods: {