ldybecklee / wepy-vant-demo

基于vant-weapp移植的一套wepy界面框架
MIT License
14 stars 6 forks source link

field组件input事件存在的一些问题 #1

Open xyohn opened 5 years ago

xyohn commented 5 years ago

原代码:

    onInput(event) {
      const { value = '' } = event.detail || {};
      this.$emit('input', value);
      this.$emit('change', value);
      this.value = value;
      this.showClear = this.methods.getShowClear.call(this, { value });
      this.$apply();
    },

子组件在捕获事件后向父组件只提供值(value) 当父组件渲染多个子组件(field)时,父组件无法得知该值的来源 建议: pros增加id 在子组件emit时提供id及value