123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- import rules from '../behaviors/rules';
- Component({
-
- behaviors: ['wx://form-field', rules],
- externalClasses: ['l-class', 'l-error-text', 'l-error-text-class', 'l-inner-class'],
- properties: {
-
- placeholder: {
- type: String,
- value: ''
- },
-
- value: {
- type: String,
- value: ''
- },
-
- focus: {
- type: Boolean,
- value: false
- },
-
- maxlength: {
- type: Number,
- value: 140
- },
-
- indicator: {
- type: Boolean,
- value: true
- },
-
- autoHeight: {
- type: Boolean,
- value: false
- },
-
- disabled: {
- type: Boolean,
- value: false
- },
-
- border: {
- type: Boolean,
- value: true
- },
-
- rules: {
- type: Object,
- },
-
- placeholderStyle: {
- type: String,
- value: ''
- }
- },
-
- data: {
- },
- attached() {
- this.initRules();
- },
-
- methods: {
- handleInputChange(event) {
- const {
- detail = {}
- } = event;
- const {
- value = ''
- } = detail;
- this.setData({
- value
- });
- this.triggerEvent('lininput', event.detail);
- },
- handleInputFocus(event) {
- this.triggerEvent('linfocus', event.detail);
- },
- handleInputBlur(event) {
- this.validatorData({
- value: event.detail.value
- });
- this.triggerEvent('linblur', event.detail);
- },
- handleInputConfirm(event) {
- this.triggerEvent('linconfirm', event.detail);
- },
-
-
-
- }
- });
|