vue中props的默认写法全集合
一、数组写法:
props: ['dialogType', 'fromOrder']
二、默认值写法
props: {
rowClick: {
type: Function,
default: function() {}
},
title: {
type: String,
default: "标题"
},
display: {
type: String,
default: "table"
},
columnCount: {
type: Number,
default: 4
},
columns: {
type: Array,
default() {
return [];
}
},
showPage: {
type: Boolean,
default: true
},
api: {
type: Object,
default() {
return {};
}
},
parameter: {
type: Object,
default() {
return {};
}
},
defaultParameter: {
type: Boolean,
default() {
return true;
}
}
},