element中的tag标签组件可移除功能bug
element
A Vue.js 2.0 UI Toolkit for Web
项目地址:https://gitcode.com/gh_mirrors/eleme/element
免费下载资源
·
文档描述:
设置closable属性可以定义一个标签是否可移除。默认的标签移除时会附带渐变动画,如果不想使用,可以设置disable-transitions属性,它接受一个Boolean,true 为关闭。
然而组件中添加closable属性后,仍无法移除响应tag
解决:绑定handleClose事件
<el-tag
v-for="tag in selected"
:key="tag"
closable
:disable-transitions="true"
type="info"
@close="handleClose(tag)"
>
<span class="el-select__tags-text">{{ tag }}</span>
</el-tag>
selected:['标签一','标签二','标签三',]
// 多选栏中的删除
handleClose(tag) {
const item = this.selected.indexOf(tag)
this.selected.splice(item, 1)
},
GitHub 加速计划 / eleme / element
54.06 K
14.63 K
下载
A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:2 个月前 )
c345bb45
6 个月前
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 6 个月前
更多推荐
已为社区贡献2条内容
所有评论(0)