From e86f72953778c3207af72a960d3ef2f627f1ea91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Wed, 14 Apr 2021 10:02:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96layer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layer/index.wc | 20 +++++++++++++++++--- src/picker/date.wc | 4 ++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/layer/index.wc b/src/layer/index.wc index b95c638..99f76d4 100644 --- a/src/layer/index.wc +++ b/src/layer/index.wc @@ -95,7 +95,7 @@ ::slotted(&__input) { flex: 1; - height: 32px; + height: 36px; } ::slotted(&__frame) { @@ -589,6 +589,8 @@ export default class Layer { unmount() { $.clearOutside(this._handlMask) $.unbind(this.__TITLE__, 'click', this._handleClose) + $.unbind(this.__CTRL__, 'click', this._handleBtnClick) + this._handleSubmit && $.unbind(this.__INPUT__, 'submit', this._handleSubmit) } watch() { @@ -733,11 +735,23 @@ Object.assign(_layer, { intercept }) }, - prompt(title = lang.TITLE, intercept) { + prompt(title = lang.TITLE, defaultValue = '', intercept) { + if (typeof defaultValue === 'function') { + intercept = defaultValue + defaultValue = '' + } + + if (!intercept) { + intercept = function(val, done) { + if (val) { + done() + } + } + } return this({ type: 'prompt', title, - content: ``, + content: ``, mask: true, intercept }) diff --git a/src/picker/date.wc b/src/picker/date.wc index 0ca8e64..6bb1f13 100644 --- a/src/picker/date.wc +++ b/src/picker/date.wc @@ -208,10 +208,10 @@ } :host(:focus-within) { - @include focus1; + // @include focus1; } :host(:focus-within[readonly]) { - @include focus2; + // @include focus2; } :host([disabled]) { opacity: 0.6;