From 0cc68d083dd9b909c2b6e70a664faead90d5dc3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 6 Sep 2019 16:19:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0number=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/form/input.wc | 10 +- src/form/number.wc | 364 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 368 insertions(+), 6 deletions(-) create mode 100644 src/form/number.wc diff --git a/src/form/input.wc b/src/form/input.wc index daccd49..7a97d1c 100644 --- a/src/form/input.wc +++ b/src/form/input.wc @@ -224,7 +224,6 @@ import '../scroll/index' import '../icon/index' import { ebind, bind, unbind, clickOutside } from '../utils' -const IS_FIREFOX = !!window.sidebar const TYPES = ['text', 'textarea', 'password'] const INPUTS = { text: '', @@ -496,11 +495,10 @@ export default class Input { case 'autofocus': this.__INPUT__.setAttribute('autofocus', '') // 辣鸡火狐, 要触发一下focus, 才能聚焦 - if (IS_FIREFOX) { - setTimeout(_ => { - this.__INPUT__.focus() - }, 10) - } + setTimeout(_ => { + this.__INPUT__.focus() + }, 10) + break // label和placeholder 功能相同 diff --git a/src/form/number.wc b/src/form/number.wc new file mode 100644 index 0000000..9bec5e2 --- /dev/null +++ b/src/form/number.wc @@ -0,0 +1,364 @@ + + + + +