xzs-mysql/source/wx/xzs-student/component/iView/input/index.js

62 lines
1.2 KiB
Java
Raw Normal View History

2020-06-14 16:44:45 +08:00
Component({
behaviors: ['wx://form-field'],
externalClasses: ['i-class'],
properties: {
title: {
type: String
},
// text || textarea || password || number
type: {
type: String,
value: 'text'
},
disabled: {
type: Boolean,
value: false
},
placeholder: {
type: String,
value: ''
},
autofocus: {
type: Boolean,
value: false
},
mode: {
type: String,
value: 'normal'
},
right: {
type: Boolean,
value: false
},
error: {
type: Boolean,
value: false
},
maxlength: {
type: Number
}
},
methods: {
handleInputChange(event) {
const { detail = {} } = event;
const { value = '' } = detail;
this.setData({ value });
this.triggerEvent('change', event);
},
handleInputFocus(event) {
this.triggerEvent('focus', event);
},
handleInputBlur(event) {
this.triggerEvent('blur', event);
}
}
});