Browse Source

计数器定时任务

yangc 8 years ago
parent
commit
6262c28c34
1 changed files with 13 additions and 14 deletions
  1. 13 14
      components/main/count/Box.vue

+ 13 - 14
components/main/count/Box.vue

@@ -32,21 +32,20 @@
       counts () {
         return this.$store.state.product.common.counts
       }
+    },
+    mounted () {
+      this.$nextTick(() => {
+        // 刷新统计信息
+        setInterval(() => {
+          this.loadCounts()
+        }, 30000)
+      })
+    },
+    methods: {
+      loadCounts () {
+        this.$store.dispatch('loadProductCounts', { _status: 'actived' })
+      }
     }
-//    mounted () {
-//      this.$nextTick(() => {
-//        this.loadCounts()
-//        // 刷新统计信息
-//        setInterval(() => {
-//          this.loadCounts()
-//        }, 30000)
-//      })
-//    },
-//    methods: {
-//      loadCounts () {
-//        this.$store.dispatch('loadProductCounts', { _status: 'actived' })
-//      }
-//    }
   }
 </script>
 <style lang="scss" scoped>