赞
踩
- <el-form-item v-if="activeName === 'phone'">
- <el-input v-model="ruleForm.phoneOrEmail" placeholder="请输入邮箱"></el-input>
- </el-form-item>
- <el-form-item v-if="activeName === 'email'" key="3" prop="phoneOrEmail">
- <el-input v-model="ruleForm.phoneOrEmail" placeholder="请输入联系电话"></el-input>
- </el-form-item>
在el-form-item加上v-if的后,发现prop失效,解决方案:加上一个key就行了,原理是dom复用
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。