Vue.component('example', {props: {// 基礎類型檢測 (`null` 意思是任何類型都可以)propA: Number,// 多種類型propB: [String, Number],// 必傳且是字符串propC: { type: String, required: true},// 數字,有默認值propD: { type: Number, default: 100},// 數組/對象的默認值應當由一個工廠函數返回propE: { type: Object, default: function () { return { message: 'hello' } }},// 自定義驗證函數propF: { validator: function (value) { return value > 10 }}}})
vuejs 的組件驗證有什么用,意義在哪
慕桂英4014372
2018-08-26 08:50:46
