From 8b879257f4f2f4891235b38064d604b932a81b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Mon, 23 Sep 2019 18:04:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96layer=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layer/index.wc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/layer/index.wc b/src/layer/index.wc index c5b7b9f..ce5ac80 100644 --- a/src/layer/index.wc +++ b/src/layer/index.wc @@ -45,6 +45,7 @@ border-radius: 4px; color: #666; font-size: 14px; + background: rgba(255, 255, 255, 0.7); box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3); transition: opacity 0.2s ease-in-out, left 0.2s ease-in-out, right 0.2s ease-in-out, top 0.2s ease-in-out, bottom 0.2s ease-in-out; @@ -600,6 +601,10 @@ class Layer { function _layer(opt) { var layDom = document.createElement('wc-layer') + if (!opt.type) { + opt.type = 'common' + } + if (opt.type === 'toast') { var { type, content } = opt @@ -667,8 +672,10 @@ function _layer(opt) { } layDom.props.type = opt.type - layDom.props.fixed = opt.fixed layDom.props.title = opt.title + if (opt.hasOwnProperty('fixed')) { + layDom.props.fixed = opt.fixed + } layDom.innerHTML = opt.content layDom.wrapped = false // 用于区分是API创建的还是包裹现有的节点