Merge branch '1.x' into 'dev'

This commit is contained in:
陈嘉涵
2019-05-10 14:24:48 +08:00
15 changed files with 43 additions and 33 deletions
+4 -2
View File
@@ -1,6 +1,7 @@
import Icon from '../icon';
import Cell from '../cell';
import { cellProps } from '../cell/shared';
import { preventDefault } from '../utils/event';
import { getRootScrollTop } from '../utils/scroll';
import { use, isObj, isDef, isIOS, suffixPx } from '../utils';
@@ -129,7 +130,7 @@ export default sfc({
},
onClear(event) {
event.preventDefault();
preventDefault(event);
this.$emit('input', '');
this.$emit('clear');
},
@@ -140,8 +141,9 @@ export default sfc({
const allowPoint = String(this.value).indexOf('.') === -1;
const isValidKey =
(keyCode >= 48 && keyCode <= 57) || (keyCode === 46 && allowPoint) || keyCode === 45;
if (!isValidKey) {
event.preventDefault();
preventDefault(event);
}
}