//子组件
// 父传子 子组件接收参数
const props = defineProps({
title: {
type: String,
default: () => "echarts 新人示例",
},
xdata: {
type: Array,
default:["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
},
ydata: {
type: Array,
// default:["50", "40", "66", "999", "100", "773"]
default:[5, 20, 36, 10, 10, 20]
},
seriesType:{
type:String,
default:'bar'
}
//父组件 传递参数
// 传递的title , ydata 值
<componentA :title="'七天数据销量'" @goParents="handleClick" />
<componentA :seriesType="'line'" :ydata="ydata" :xdata="xdata" />
// 局部注册组件a
import componentA from "@/components/componentA.vue";