@dolphinweex/weex-vue-render 0.2.59 → 0.2.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.common.js +12 -3
- package/package.json +1 -1
package/dist/index.common.js
CHANGED
|
@@ -2919,9 +2919,16 @@ function mapFormEvents (context) {
|
|
|
2919
2919
|
var eventMap = {};['input', 'change', 'focus', 'blur', 'return'].forEach(function (type) {
|
|
2920
2920
|
eventMap[type] = function (event) {
|
|
2921
2921
|
if (context.$el) {
|
|
2922
|
+
if(context.type === 'number' && (context.$el.value || context.$el.lastValue)){
|
|
2923
|
+
if(context.$el.validationMessage){//如果有报错语句 拦截使用上次数据
|
|
2924
|
+
context.$el.value = context.$el.lastValue
|
|
2925
|
+
}
|
|
2926
|
+
context.$el.value = context.$el.value.replace(/[^0-9eE\.\-\+]/g, '');//数字规则
|
|
2927
|
+
}
|
|
2922
2928
|
if(context.maxlength && context.$el.value){
|
|
2923
2929
|
context.$el.value = context.$el.value.slice(0,context.maxlength)
|
|
2924
2930
|
}
|
|
2931
|
+
context.$el.lastValue = context.$el.value;
|
|
2925
2932
|
event.value = context.$el.value;
|
|
2926
2933
|
// for the sake of v-model, a input event must be emitted.
|
|
2927
2934
|
if (type === 'input') {
|
|
@@ -2932,7 +2939,6 @@ function mapFormEvents (context) {
|
|
|
2932
2939
|
});
|
|
2933
2940
|
return eventMap
|
|
2934
2941
|
}
|
|
2935
|
-
|
|
2936
2942
|
/*
|
|
2937
2943
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
2938
2944
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -5143,7 +5149,10 @@ var inputCommon = {
|
|
|
5143
5149
|
if (autofocus) {
|
|
5144
5150
|
this.$el && weex.requireModule('bridgeModule').commandInterface(JSON.stringify({ operation: 'showKeyboard'}))
|
|
5145
5151
|
}
|
|
5146
|
-
|
|
5152
|
+
//dom可能没有被获取到,延迟触发
|
|
5153
|
+
setTimeout(() => {
|
|
5154
|
+
this.$el && this.$el.focus();
|
|
5155
|
+
}, 200);
|
|
5147
5156
|
},
|
|
5148
5157
|
blur: function blur () {
|
|
5149
5158
|
this.$el && this.$el.blur();
|
|
@@ -5571,7 +5580,7 @@ function getInput (weex) {
|
|
|
5571
5580
|
if (!this._id) {
|
|
5572
5581
|
this._id = idCount++;
|
|
5573
5582
|
}
|
|
5574
|
-
var events = mapFormEvents
|
|
5583
|
+
var events = extend(mapFormEvents(this));
|
|
5575
5584
|
return createElement('html:input', {
|
|
5576
5585
|
attrs: {
|
|
5577
5586
|
'weex-type': 'input',
|
package/package.json
CHANGED