Vue报错 type check failed for prop “xxx“. Expected String with value “xx“,got Number with value ‘xx‘

时间:2022-09-03 21:34:32

vue报错    [Vue warn]: Invalid prop: type check failed for prop "name". Expected String with value "4", got Number with value 4.

Vue报错 type check failed for prop “xxx“. Expected String with value “xx“,got Number with value ‘xx‘

当出现这个错误原因在于写法上漏了数字和字符串的类型关系

Vue报错 type check failed for prop “xxx“. Expected String with value “xx“,got Number with value ‘xx‘

引用了我们定义的数组和变量或者函数

Vue报错 type check failed for prop “xxx“. Expected String with value “xx“,got Number with value ‘xx‘

这个问题就是我们点击:name默认的类型是字符串类型,而我们自己定义的是数字类型所以我们需要改一下就好

Vue报错 type check failed for prop “xxx“. Expected String with value “xx“,got Number with value ‘xx‘

希望上述能帮到你