初步实现数据图表,待完善

This commit is contained in:
ngfchl
2022-11-26 11:46:49 +08:00
parent e541b2c12a
commit aaed994480
8 changed files with 581 additions and 10 deletions

View File

@@ -0,0 +1,27 @@
/**
* 封装echarts可以在vue中使用
*/
Vue.component('charts', {
props: ['option', 'style'], data: function () {
return {}
}, mounted: function () {
this.$nextTick(function () {
var el = this.$el;
var chart = echarts.init(el, 'dark');
chart.setOption(this.option);
this.chart = chart
})
}, watch: {
obj: {
option(newValue, oldValue) {
// option发生变化时自动重新渲染
this.chart.setOption(newValue)
}, // immediate: true,
deep: true,
}
}, template: '<div :style="style">{{option}}</div>'
})

45
static/js/echarts.min.js vendored Normal file

File diff suppressed because one or more lines are too long