vue+element-ui select多选框赋值之后触发change事件和remove-tag事件
element
A Vue.js 2.0 UI Toolkit for Web
项目地址:https://gitcode.com/gh_mirrors/eleme/element
免费下载资源
·
由于业务需求,需要在页面上使用element-ui的select多选框的方法,当select为空时,change事件和remove-tag事件可以完美呈现,但是当select中赋值后,change事件和remove-tag事件可以触发,但是页面上没有反应。
<el-select v-model="debt.borrowers" filterable multiple placeholder="可直接搜索、多选" @change="change">
<el-option v-for="item in borrowerOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
此时,应当在change事件中添加一个VUE本身的$forceUpdate方法进行强制渲染。
change () {
this.$forceUpdate()
},
GitHub 加速计划 / eleme / element
54.06 K
14.63 K
下载
A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:1 个月前 )
c345bb45
5 个月前
a07f3a59
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update table.md
* Update transition.md
* Update popover.md 5 个月前
更多推荐
已为社区贡献3条内容
所有评论(0)