在vue中这个书写有问题吗, <div v-for="item in this.form.options" :key="item.userId">{{item.nickName}}</div>
时间: 2024-03-27 19:38:52 浏览: 64
在Vue.js中,不建议在模板中使用`this`关键字。所以,这个代码片段中的`this`是多余的,应该将其删除,正确的写法是:
```html
<div v-for="item in form.options" :key="item.userId">{{ item.nickName }}</div>
```
在Vue.js中,模板中的表达式会自动绑定到Vue实例的数据对象上,所以不需要使用this关键字来引用Vue实例中的数据。
阅读全文
相关推荐


















