import ECharts from 'echarts'
import VueEcharts from 'vue-echarts'
// scss样式
import './styles/index.scss'
Vue.component('v-chart', VueEcharts)
<v-chart :options="chartOption" />
chartOption: {
grid: {
top: 70,
left: 60,
right: 60,
bottom: 50
},
xAxis: {
type: 'category',
data: [
'1月',
'2月',
'3月',
'4月',
'5月',
'6月',
'7月',
'8月',
'9月',
'10月',
'11月',
'12月'
]
},
yAxis: {},
series: [
{
type: 'bar',
data: [250, 50, 100, 300, 500, 420, 250, 300, 500, 420, 250, 100]
}
]
},

父元素有高度,它的高度也设置的100%,但是没显示图表,老师加我一下QQ:1069571163,我把代码发你帮我看看呗,代码在私人仓库里面,麻烦你了谢谢。