<script>
import echarts from 'echarts';
import 'echarts-liquidfill';
export default {
name:'Home',
data() {
return {
}
},
created(){
this.liquidFill();
},
mounted() {//在这个生命周期中初始化
this.liquidFill();
},
methods: {
liquidFill (){//方法
var myChart = echarts.init(document.getElementById('main'));
var option = {
series: [{
type: 'liquidFill',
data: [0.6]
}]
};
myChart.setOption(option);
}
}
}
<script>
<style scoped>
</style>