使用el-input,输入内容时报错如图,但是我全局搜索了,也没有找到报错的isPersonal。我在自己的代码登录页面中也使用了el-form结合el-input,输入内容时也没报这个错,只有这个页面报错。我检查了两处el-input的用法,也是一样的,很迷惑这个报错是什么原因引起的。
报错的页面用法:
<el-form-item label="客户姓名" prop="clientName">
<el-input v-model="clientForm.clientName" type="text"></el-input>
</el-form-item>
正确的登录页面用法:
<el-form-item label="" prop="account" class="account-input">
<el-input
v-model="loginForm.account"
placeholder="请输入手机号登录"
prefix-icon="el-icon-user-solid"
type="text"
clearable
></el-input>
</el-form-item>
看下clientForm.clientName有没有对这个值进行监听
贴出的代码者报错没关系,这个报错的意思是一个值为undefined或者null的变量没有isPersonal属性
所以可能出错的是一个变量x,而x是null或者undefined,你使用了x.isPersonal导致报错