Bug Type: Component
Environment
- Vue Version:
3.2.47
- Element Plus Version:
2.3.0
- Browser / OS:
chrome100
- Build Tool:
Webpack
Reproduction
Related Component
el-checkbox
Reproduction Link
Element Plus Playground
Steps to reproduce
1.el-form-item中for属性没起作用,当在 el-form-item 内只有一个复选框,表单项的标签将自动附加在复选框上
2.点击checkbox的标签,checkbox的选中状态会改变
<script setup>
defineProps({ /* ... */ })
</script>
<template>
<el-form>
<el-form-item label="sfsfs" for="">
<el-checkbox></el-checkbox>
</el-form-item>
</el-form>
</template>
What is Expected?
点击复选框的标签,复选框选中状态不会被改变
What is actually happening?
点击复选框标签,复选框会被选中或取消选中。当只有复选框在表单项中使用时,为表单项添加for属性,也不能解除将label赋给复选框。
Additional comments
(empty)
1条答案
按热度按时间w51jfk4q1#
for 参数不论是有值还是空字符串都不起作用!