From 383d3f78b09dc924ef7ec04164319d691afcef81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 9 Aug 2019 19:40:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96input=E5=92=8Cdate=E7=9A=84?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F;date=E5=A2=9E=E5=8A=A0slot=E7=9A=84=E6=94=AF?= =?UTF-8?q?=E6=8C=81;=E7=A7=BB=E9=99=A4router/layer=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.prod.js | 2 +- src/form/button.wc | 47 ++++++++++++++++++++---------------------- src/form/input.wc | 7 +++---- src/layer/index.js | 9 ++++---- src/picker/date.wc | 50 +++++++++++++++++++++++++++++++++++++++++---- src/router/index.js | 40 ------------------------------------ 6 files changed, 76 insertions(+), 79 deletions(-) diff --git a/build.prod.js b/build.prod.js index 224c6cb..0265602 100644 --- a/build.prod.js +++ b/build.prod.js @@ -49,8 +49,8 @@ function fixImport(str) { const compileJs = (entry, output) => { let t1 = Date.now() let buf = fs.cat(entry).toString() + buf = fixImport(buf) let { code } = uglify.minify(buf) - code = fixImport(code) log( '编译JS: %s, 耗时 %s ms', diff --git a/src/form/button.wc b/src/form/button.wc index 48b50eb..79f06b5 100644 --- a/src/form/button.wc +++ b/src/form/button.wc @@ -9,24 +9,27 @@ :host { overflow: hidden; display: inline-block; + min-width: 64px; + height: 32px; user-select: none; -moz-user-select: none; color: nth($cd, 2); + font-size: 14px; cursor: pointer; button { display: flex; justify-content: center; align-items: center; - min-width: 32px; - width: inherit; + width: 100%; height: inherit; padding: 0 5px; margin: auto; - font-size: 14px; border: 1px solid nth($cp, 3); border-radius: 4px; + white-space: nowrap; background: #fff; + font-size: inherit; outline: none; color: inherit; cursor: inherit; @@ -50,9 +53,10 @@ border-radius: 21px; } :host([circle]) { + min-width: 32px; button { - border-radius: 50%; padding: 0; + border-radius: 50%; } .icon { margin-right: 0; @@ -60,37 +64,29 @@ } :host([size='large']) { - button { - min-width: 120px; - height: 42px; - font-size: 16px; - } + min-width: 120px; + height: 42px; + font-size: 16px; + .icon { --size: 20px; } } :host([size='large'][circle]) { - button { - min-width: 42px; - } + min-width: 42px; } :host([size='medium']) { - button { - min-width: 90px; - height: 36px; - } + min-width: 90px; + height: 36px; } :host([size='medium'][circle]) { - button { - min-width: 36px; - } + min-width: 36px; } :host([size='mini']) { - button { - min-width: 24px; - height: 24px; - font-size: 12px; - } + min-width: 24px; + height: 24px; + font-size: 12px; + .icon { --size: 14px; } @@ -100,11 +96,12 @@ :host([disabled]) { cursor: not-allowed; color: nth($cgr, 1); + opacity: 0.6; + .icon { color: nth($cgr, 1); } button { - opacity: 0.6; background: #fff; } } diff --git a/src/form/input.wc b/src/form/input.wc index b208fc9..644f2c2 100644 --- a/src/form/input.wc +++ b/src/form/input.wc @@ -42,7 +42,9 @@ li { input, textarea { + flex: 1; min-width: 0; + height: 100%; padding: 0 5px; border: 0; border-radius: inherit; @@ -59,7 +61,6 @@ li { } textarea { width: 100%; - height: 100%; padding: 5px; resize: none; } @@ -81,9 +82,7 @@ li { border-left: 1px solid nth($cp, 3); border-radius: 0 4px 4px 0; } - &[prepend] .prepend { - display: flex; - } + &[prepend] .prepend, &[append] .append { display: flex; } diff --git a/src/layer/index.js b/src/layer/index.js index 64eac6b..9fa3e61 100644 --- a/src/layer/index.js +++ b/src/layer/index.js @@ -8,7 +8,6 @@ 'use strict' import '../drag/index' -import 'css/layer-normal.scss' Anot.ui.layer = '1.0.0-normal' @@ -245,7 +244,7 @@ class __layer__ { let layBox = document.createElement('div') outerBox.setAttribute('anot', $id) - outerBox.setAttribute(':click', 'onMaskClick') + outerBox.setAttribute(':on-click', 'onMaskClick') outerBox.classList.add('do-layer') if (state.mask) { @@ -281,7 +280,7 @@ class __layer__ { } layBox.setAttribute('ref', 'layer') - // layBox.setAttribute(':click', 'cancelBubble') + // layBox.setAttribute(':on-click', 'cancelBubble') // 暂时隐藏,避免修正定位时,能看到闪一下 layBox.style.cssText += 'border-radius:' + state.radius + 'px' @@ -359,7 +358,7 @@ class __layer__ { let html = '' let btns = ` @@ -368,7 +367,7 @@ class __layer__ { btns = ` ` + btns diff --git a/src/picker/date.wc b/src/picker/date.wc index 72f8c5a..e0b8148 100644 --- a/src/picker/date.wc +++ b/src/picker/date.wc @@ -1,5 +1,6 @@