问题

报错

props: {
    showcontent: {
      type: Array,
      default: []
    },
}

报错信息

问题解决

props: {
    showcontent: {
      type: Array,
      default: function () { return [] }
    },
}

ES6

props: {
    showcontent: {
      type: Array,
      default: () => []
    },
}

Vue自定义组件Props中接收数组


易函123
1.2k 声望7 粉丝

我知道吹过的牛b,也会随青春一笑了之!!