created() {
this.$scpoe.getgoodsinfo = this.getgoodsinfo
}, async getgoodsinfo(e) {
console.log(e, "eeeeee")
return new Promise(resolve => {
resolve({
minLimits: 1,
relationType: 1,
validation: {
phoneNumber: {
required: true // 手机号是否必填
},
reservationType: 2,
reservationCount: 2,
},
// 在 bind:getgoodsinfo 返回的 promise 的 resolve 函数中新增 marketingVersion 字段
marketingVersion: 2,
})
console.log(e, "商品222")
})
},报错 [Vue warn]: Error in created hook: "TypeError: Cannot set properties of undefined (setting 'getgoodsinfo')" created() {
this.$scpoe.getgoodsinfo = this.getgoodsinfo
}, errMsg: "getGoodsInfo should be object, but got undefined"