一、数组方式
props: ['Parentvalue1','Parentvalue2','Parentvalue3']
二、对象方式
props: {
// 属性值限定类型
parentValue1: Object,
parentValue2: String,
parentValue3: Array
}
三、props属性中的对象方式
props: {
parentValue1: {
// 类型为字符串
type: String,
// (不传值的时候)默认parentValue1的值为15
default:15
},
parentValue2: {
// 类型为数组
type: Array,
// 必传属性
required:true
},
parentValue3: {
// 类型为对象
type: Object
}
}