zoukankan      html  css  js  c++  java
  • iview的坑级bug

    1.怎么清除iview中下拉列表中的数据

    <Select
                    v-model="newUser.parent"
                    placeholder="一级服务"
                    ref="resetSelect"
                    clearable
                    style=" 220px">
                    <Option
                      v-for="item in parentList"
                      :value="item.serviceId"
                      :key="item.serviceId">{{ item.serviceName }}
                    </Option>
                  </Select>
     
    //iview中select中放入 ref="resetSelect"   并且配置属性clearable
    this.$refs.resetSelect.clearSingleSelect()
     

    2.iview 下拉框清空问题,清除遗留的focus样式

    <Select clearable :disabled="isSee" v-model="formData.baseId" placeholder="请选择行业"
    name="select" ref='可自定义,但是必须要存在'>
    <Option
    v-for="item in categoryList"
    :value="item.id"
    :key="item.id"
    >{{ item.name }}</Option>
    </Select>
    首先我们需要一个固定name做全局响应

    然后,去mixin.js也就是一个公共js中去改写并利用iview源码的规则清空focus存在的样式

    handleCancleModel() {
    // 取消创建
    this.showDrawer = false
    Object.keys(this.$refs).forEach((item) => {
    if (this.$refs[item] && this.$refs[item].name === 'select') {
    this.$refs[item].reset()
    }
    })
    this.$emit('close')
    this.handleReset()
    },
    清除的就是下面这个灰色样式

  • 相关阅读:
    3:Exchange2016图形化安装和无人值守安装
    hdu 3980 Paint Chain (sg)
    hdu 1850 Being a Good Boy in Spring Festival (Nim)
    zoj 2971 Give Me the Number
    hdu 1847 Good Luck in CET4 Everybody! (sg)
    hdu 1754 I hate it (线段树)
    poj 1704 Georgia ans Bob (StaircaseNim)
    hdu 1907 John (Nim变形)
    hdu 1536 SNim (sg)
    hdu 1166 敌兵布阵 (线段树)
  • 原文地址:https://www.cnblogs.com/qdwz/p/14510617.html
Copyright © 2011-2022 走看看