mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-05-23 23:19:15 +08:00
[breaking change] Field: 修复组件错误的事件参数 (#391)
* 优化编译脚本,在预览时降低编译频率 * 修复 field 事件传参 * 降低等待事件
This commit is contained in:
parent
5ee309639a
commit
d2ef7fbc03
@ -7,6 +7,9 @@
|
||||
placeholder="{{ config.base.name.placeholder }}"
|
||||
focus="{{ config.base.name.focus }}"
|
||||
value="{{ value }}"
|
||||
bind:change="handleZanFieldChange"
|
||||
bind:focus="handleZanFieldFocus"
|
||||
bind:blur="handleZanFieldBlur"
|
||||
>
|
||||
</zan-field>
|
||||
<zan-field
|
||||
@ -14,6 +17,7 @@
|
||||
placeholder="{{ config.base.tel.placeholder }}"
|
||||
error="{{ config.base.tel.error }}"
|
||||
input-type="{{ config.base.tel.inputType }}"
|
||||
bind:change="handleZanFieldChange"
|
||||
>
|
||||
</zan-field>
|
||||
<zan-field
|
||||
@ -21,12 +25,14 @@
|
||||
type="{{ config.base.address.type }}"
|
||||
placeholder="{{ config.base.address.placeholder }}"
|
||||
maxlength="50"
|
||||
bind:change="handleZanFieldChange"
|
||||
>
|
||||
</zan-field>
|
||||
<zan-field
|
||||
title="{{ config.base.disabled.title }}"
|
||||
value="{{ config.base.disabled.value }}"
|
||||
disabled="{{ config.base.disabled.disabled }}"
|
||||
bind:change="handleZanFieldChange"
|
||||
>
|
||||
</zan-field>
|
||||
</zan-cell-group>
|
||||
|
2422
package-lock.json
generated
2422
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -57,6 +57,7 @@
|
||||
"gulp-remove-logging": "^1.2.0",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-util": "^3.0.8",
|
||||
"lodash": "^4.17.10",
|
||||
"node-watch": "^0.5.5",
|
||||
"postcss-calc": "^6.0.1",
|
||||
"postcss-easy-import": "^3.0.0",
|
||||
|
@ -44,15 +44,15 @@ Component({
|
||||
const { value = '' } = detail;
|
||||
this.setData({ value });
|
||||
|
||||
this.triggerEvent('change', event);
|
||||
this.triggerEvent('change', { ...detail });
|
||||
},
|
||||
|
||||
handleFieldFocus(event) {
|
||||
this.triggerEvent('focus', event);
|
||||
handleFieldFocus({ detail = {} }) {
|
||||
this.triggerEvent('focus', { ...detail });
|
||||
},
|
||||
|
||||
handleFieldBlur(event) {
|
||||
this.triggerEvent('blur', event);
|
||||
handleFieldBlur({ detail = {} }) {
|
||||
this.triggerEvent('blur', { ...detail });
|
||||
},
|
||||
|
||||
updateIsLastElement(isLastField) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs-extra');
|
||||
const nodeWatch = require('node-watch');
|
||||
const debounce = require('lodash/debounce');
|
||||
require('shelljs/global');
|
||||
|
||||
module.exports = function (config = {}) {
|
||||
@ -10,10 +11,11 @@ module.exports = function (config = {}) {
|
||||
extracter(config);
|
||||
|
||||
if (config.watch) {
|
||||
nodeWatch(config.src, { recursive: true }, () => extracter(config));
|
||||
nodeWatch(config.src, { recursive: true }, () => debouncedFunc(config));
|
||||
}
|
||||
};
|
||||
|
||||
const debouncedFunc = debounce(config => extracter(config), 500);
|
||||
|
||||
function extracter(config = {}) {
|
||||
// 复制 src
|
||||
|
Loading…
x
Reference in New Issue
Block a user