文档描述:

设置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 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐