From b82df5453b03b1e04ba6c461d6d85e073afd0842 Mon Sep 17 00:00:00 2001 From: wangao <1366463855@qq.com> Date: Mon, 18 Nov 2019 15:24:04 +0800 Subject: [PATCH] style(input): i-input emit event from 'change' to 'input' and add confirm event --- src/input/index.js | 6 +++++- src/input/index.wxml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/input/index.js b/src/input/index.js index c9d4c41..34a1545 100644 --- a/src/input/index.js +++ b/src/input/index.js @@ -47,7 +47,7 @@ Component({ const { value = '' } = detail; this.setData({ value }); - this.triggerEvent('change', event); + this.triggerEvent('input', event); }, handleInputFocus(event) { @@ -56,6 +56,10 @@ Component({ handleInputBlur(event) { this.triggerEvent('blur', event); + }, + + handleInputConfirm(event){ + this.triggerEvent('confirm', event); } } }); diff --git a/src/input/index.wxml b/src/input/index.wxml index 52b0ee3..99f8004 100644 --- a/src/input/index.wxml +++ b/src/input/index.wxml @@ -27,5 +27,6 @@ bindinput="handleInputChange" bindfocus="handleInputFocus" bindblur="handleInputBlur" + bindconfirm="handleInputConfirm" />