提交
This commit is contained in:
38
甲情_甲意/miniprogram/node_modules/antd-mini/less/Input/index.js
generated
vendored
Normal file
38
甲情_甲意/miniprogram/node_modules/antd-mini/less/Input/index.js
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
import { Component, triggerEvent } from '../_util/simply';
|
||||
import { InputDefaultProps } from './props';
|
||||
import mixinValue from '../mixins/value';
|
||||
Component(InputDefaultProps, {
|
||||
onChange: function (e) {
|
||||
var value = e.detail.value;
|
||||
if (!this.isControlled()) {
|
||||
this.update(value);
|
||||
}
|
||||
triggerEvent(this, 'change', value, e);
|
||||
},
|
||||
onFocus: function (e) {
|
||||
var value = e.detail.value;
|
||||
this.setData({
|
||||
selfFocus: true,
|
||||
});
|
||||
triggerEvent(this, 'focus', value, e);
|
||||
},
|
||||
onBlur: function (e) {
|
||||
var value = e.detail.value;
|
||||
this.setData({
|
||||
selfFocus: false,
|
||||
});
|
||||
triggerEvent(this, 'blur', value, e);
|
||||
},
|
||||
onConfirm: function (e) {
|
||||
var value = e.detail.value;
|
||||
triggerEvent(this, 'confirm', value, e);
|
||||
},
|
||||
onClear: function (e) {
|
||||
if (!this.isControlled()) {
|
||||
this.update('');
|
||||
}
|
||||
triggerEvent(this, 'change', '', e);
|
||||
},
|
||||
}, {
|
||||
selfFocus: false,
|
||||
}, [mixinValue({ scopeKey: 'state' })]);
|
Reference in New Issue
Block a user