1、错误描述
log.js?1afd:24 [HMR] Waiting for update signal from WDS...
vue.runtime.esm.js?2b0e:3261
Uncaught TypeError: Right-hand side of 'instanceof' is not an object
at assertType (vue.runtime.esm.js?2b0e:1703)
at assertProp (vue.runtime.esm.js?2b0e:1662)
at validateProp (vue.runtime.esm.js?2b0e:1596)
at loop (vue.runtime.esm.js?2b0e:3442)
at initProps (vue.runtime.esm.js?2b0e:3475)
at initState (vue.runtime.esm.js?2b0e:3416)
at VueComponent.Vue._init (vue.runtime.esm.js?2b0e:4720)
at new VueComponent (vue.runtime.esm.js?2b0e:4888)
at createComponentInstanceForVnode (vue.runtime.esm.js?2b0e:4391)
at init (vue.runtime.esm.js?2b0e:4222)
2、错误原因
message后面应该是一个数据类型,如String、Number
<template>
<div></div>
</template>
<script>
export default{
name: 'You',
props: {
message: '欢迎光临!'
}
}
</script>
<style>
</style>
3、解决办法
由于message是个字符串类型,需要写成message:String
<template>
<div>{{message}}</div>
</template>
<script>
export default{
name: 'You',
props: {
message: String
}
}
</script>
<style>
</style>