Vue开发报错:Incorrect use of <label for=FORM_ELEMENT>

1. 问题起因

在写自己的demo的时候发现错误Incorrect use of <label for=FORM_ELEMENT>,其实就是提醒没有正确使用label
请添加图片描述
通过资源提示找到节点发现是label标签和input标签没有对应。

解决方法

在有label属性的标签中加入for属性,需要和input中的id属性对应。

  <el-form-item label="账号" prop="account" for="account">
  <el-input
    v-model="formInline.account"
    placeholder="账号"
    id="account"
  >
  </el-input>

在报错中的了解详情里可以跳转至文档,查看文档的例子。
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_43563956/article/details/131957047