Vue 内置component标签实现动态切换组件
// An highlighted block
components: {
Histogram: () => import('@/components/service/chart/Histogram'),//柱状图,
FanChart: () => import('@/components/service/chart/FanChart'),//扇形图,,
LineChart: () => import('@/components/service/chart/LineChart'),//折线图,,
}
<component
:is="currentView"
@daysfun="daysfun"
ref="mychild"
></component>
data{
return{
currentView: "Histogram",
}
methods:{
cutChart(t) {
this.currentView = "FanChart“
}
}