我按照说明通过CDN安装,但在HTML上却出现以下错误:
CS0103:名称“标签”在当前上下文中不存在
我的html:
<multiselect v-model="value" tag-placeholder="Add this as new tag" placeholder="Search or add a tag" label="name" track-by="code" :options="options" :multiple="true" :taggable="true" @tag="addTag"></multiselect>
我的脚本:
methods: {
addTag(newTag) {
const tag = {
name: newTag,code: newTag.substring(0,2) + Math.floor((Math.random() * 10000000))
}
this.options.push(tag)
this.value.push(tag)
}
}
有人可以帮助我吗?