https://blog.youkuaiyun.com/qq_42597536/article/details/90056775
大佬连接可以直接用 我把它封装成组件了
<div :class="className" :style="{height:height,width:width}" style="margin-top: 35px"/>
</template>
<script>
import echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
const animationDuration = 6000
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '200px'
}
},
data() {
return {
chart: null
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
Vue封装echarts水波球组件

博客给出相关链接,博主将其封装成组件,只需保证项目引入echarts,直接贴代码即可使用,涉及Vue绘制水波球相关内容。
最低0.47元/天 解锁文章
1099

被折叠的 条评论
为什么被折叠?



