(已解决)Property or method “userName“ is not defined on the instance but referenced during render. Make

问题:没定义就用了。

参考了别人的解决办法,使用 let 进行声明 userName后,发现无法解决

个人解决方法以及问题:

vue的template中:

vue的js中:

(已解决)Property or method “userName“ is not defined on the instance but referenced during render. Make_第1张图片

问题:v-model绑定无法找到对应对象,所以显示未定义。

解决:通过层级点出来

(已解决)Property or method “userName“ is not defined on the instance but referenced during render. Make_第2张图片

你可能感兴趣的:(vue.js,前端,javascript)