Vue2升级Vue3报错:Right-hand side of ‘instanceof‘ is not an object

属性prop设置多类型报错:

 Vue2 写法:支持用竖线隔开。Vue2 Prop

expandLevel: {
	type: Number | String,
	default: 1,
},

Vue3 写法:改为数组,不支持竖线隔开。Vue3 Prop

expandLevel: {
	type: [Number, String],
	default: 1,
}

猜你喜欢

转载自blog.csdn.net/sinat_31213021/article/details/132101523
今日推荐