vue.js - 这个 'v-if' 应该被移动到包装器元素(vue/no-use-v-if-with-v-for)
问题描述
使用 v-if 和 v-for 时出现 lint 错误。解决它的最佳方法是什么?
<div>
<input class="input is-static"
type="text"
v-model="userId"
readonly
v-if=" type === 'Admin'" />
<div class="buttons">
<button v-if="type !== 'Admin'"
v-for="(option, index) in users" :key="index">
{{ option }}
</button>
</div>
</div>
解决方案
推荐阅读
- mysql - Visual Basic 使用 ODBC 设置和寄存器连接数据库
- python - 使用 os.walk() 从文件夹中的图像保存像素值时速度极慢
- python - 在python中定义和绘制常量函数
- azure - 使用自定义 SAML 策略注册 B2C 应用程序 - 配置声明
- html - 圆形复选框内的内部间距
- excel - 关闭 Excel 宏中的计算不起作用
- angular - 动态查找服务实现
- sql - 用单个 IN 或 ANY 运算符替换多个 OR 运算符
- python - pip install -U yotta : Win10 出现错误
- python - 如何使用字符串作为排序序列?