export default {
props: {
slides:{ type:Array, default:[] }
},這是我的代碼
報錯是Invalid default value for prop "slides": Props with type Object/Array must use a factory function to return the default value.
// 數組/對象的默認值應當由一個工廠函數返回
// 這是文檔里的例子,返回對象 propE: { type: Object, default: function () { return { message: 'hello' } } },
// 返回數組的默認值 proE: { type: Array, default: function () { return [] } }