Browse Source

修正生命周期钩子,将`beforeDestroy`更改为`beforeUnmount` (#738) (#742)

优化将beforeDestroy更改为beforeUnmount
main
奇淼(piexlmax 3 years ago
committed by GitHub
parent
commit
87eb5fe664
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      web/src/view/dashboard/dashbordCharts/echartsLine.vue
  2. 2
      web/src/view/layout/aside/historyComponent/history.vue
  3. 2
      web/src/view/layout/aside/index.vue
  4. 2
      web/src/view/layout/screenfull/index.vue
  5. 2
      web/src/view/system/state.vue

2
web/src/view/dashboard/dashbordCharts/echartsLine.vue

@ -51,7 +51,7 @@ export default {
this.initChart() this.initChart()
}) })
}, },
beforeDestroy() {
beforeUnmount() {
if (!this.chart) { if (!this.chart) {
return return
} }

2
web/src/view/layout/aside/historyComponent/history.vue

@ -120,7 +120,7 @@ export default {
} }
this.setTab(this.$route) this.setTab(this.$route)
}, },
beforeDestroy() {
beforeUnmount() {
emitter.off('collapse') emitter.off('collapse')
emitter.off('mobile') emitter.off('mobile')
}, },

2
web/src/view/layout/aside/index.vue

@ -58,7 +58,7 @@ export default {
this.isCollapse = item this.isCollapse = item
}) })
}, },
beforeDestroy() {
beforeUnmount() {
emitter.off('collapse') emitter.off('collapse')
}, },
methods: { methods: {

2
web/src/view/layout/screenfull/index.vue

@ -90,7 +90,7 @@ export default {
screenfull.on('change', this.changeFullShow) screenfull.on('change', this.changeFullShow)
} }
}, },
destroyed() {
unmounted() {
screenfull.off('change', this.changeFullShow) screenfull.off('change', this.changeFullShow)
}, },
methods: { methods: {

2
web/src/view/system/state.vue

@ -159,7 +159,7 @@ export default {
this.reload() this.reload()
}, 1000 * 10) }, 1000 * 10)
}, },
beforeDestroy() {
beforeUnmount() {
clearInterval(this.timer) clearInterval(this.timer)
this.timer = null this.timer = null
}, },

Loading…
Cancel
Save