解决ie11下antd-vue input的clear点击无效

需要在按需加载的文件下加上以下代码:

if (!!window.ActiveXObject || 'ActiveXObject' in window) {

  Input.methods.handleReset = function () {

    this.stateValue = ''

    this.$emit('change.value', '')
    this.$emit('input', '')
    this.$emit('change', '')

  }

  Input.TextArea.methods.handleReset = function () {

    this.stateValue = ''

    this.$emit('change.value', '')
    this.$emit('input', '')
    this.$emit('change', '')
  }

}

全部代码

import {
  Input,
} from 'ant-design-vue'
import Vue from 'vue'

Vue.prototype.$notification = notification

if (!!window.ActiveXObject || 'ActiveXObject' in window) {

  Input.methods.handleReset = function () {

    this.stateValue = ''

    this.$emit('change.value', '')
    this.$emit('input', '')
    this.$emit('change', '')

  }

  Input.TextArea.methods.handleReset = function () {

    this.stateValue = ''

    this.$emit('change.value', '')
    this.$emit('input', '')
    this.$emit('change', '')
  }

}

export default {  Input,
}

你可能感兴趣的:(vue.js,javascript,ecmascript)