The ant-design input search box listens to the allowClear event alone

Bind onChange event

      <a-input
              :allowClear="true"
              style="width: 280px"
              @change="change"
              placeholder="请输入"
            />

The method triggered by the onChange event can determine whether it is input or click to clear

   change(row) {
    //   console.log(row.target.tagName, 'row', row.type);
      if (row.type == 'click') {
        console.log('触发清除')
      }
    },

Judging by type

Guess you like

Origin blog.csdn.net/slow097/article/details/125843012