feat(视图): echarts组件封装,初步实现

This commit is contained in:
junjie 2021-03-11 15:19:44 +08:00
parent 00bce0ee7e
commit 6c28ec072e

View File

@ -16,7 +16,9 @@ export default {
}
},
data() {
return {}
return {
myChart: {}
}
},
watch: {
chart() {
@ -24,6 +26,8 @@ export default {
}
},
mounted() {
// domecharts
this.myChart = this.$echarts.init(document.getElementById('echart'))
},
methods: {
drawEcharts() {
@ -48,12 +52,10 @@ export default {
this.myEcharts(chart_option)
},
myEcharts(option) {
// domecharts
var myChart = this.$echarts.init(document.getElementById('echart'))
//
setTimeout(myChart.setOption(option, true), 500)
setTimeout(this.myChart.setOption(option, true), 500)
window.onresize = function() {
myChart.resize()
this.myChart.resize()
}
}
}