Error in nextTick: “TypeError: Right-hand side of ‘instanceof‘ is not an object“
1、Error in nextTick: “TypeError: Right-hand side of ‘instanceof’ is not an object”翻译:nextTick中的错误:“TypeError:'instanceof’的右侧不是对象”2、页面的写法:props: {detailPageNum: 1},3、修改成:props: {detailPageNum: {type: N
·
1、Error in nextTick: “TypeError: Right-hand side of ‘instanceof’ is not an object” 翻译:nextTick中的错误:“TypeError:'instanceof’的右侧不是对象”
2、页面的写法:
props: {
detailPageNum: 1
},

3、修改成:
props: {
detailPageNum: {
type: Number,
default: 1
}
},
4、拓展:(required选项来声明这个参数是否必须传入)
props: {
detailPageNum: {
type: Number,
required: false,
default: 1
},
detailPageString: {
type: String,
default: ""
},
detailPageArray: {
type: Array,
default: () => []
},
detailPageObj: {
type: Object,
default: () => {}
}
},
官网地址:https://vue3js.cn/docs/zh/guide/component-props.html#prop-%E7%B1%BB%E5%9E%8B
世界再大,没有我想你的心大
更多推荐




所有评论(0)