// props
props: {
testString: {
type: String,
default: ''
},
testNumber: {
type: Number,
default: 0
},
testBoolean: {
type: Boolean,
default: true
},
testArray: {
type: Array,
default: () => []
},
testObject: {
type: Object,
default: () => ({})
},
testFunction: {
type: Function,
default: function () { }
}
}
vue 中props的默认
于 2023-06-30 09:20:00 首次发布