This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

优化layer默认配置

old
宇天 2019-09-23 18:04:47 +08:00
parent c36ea5509b
commit 8b879257f4
1 changed files with 8 additions and 1 deletions

View File

@ -45,6 +45,7 @@
border-radius: 4px; border-radius: 4px;
color: #666; color: #666;
font-size: 14px; font-size: 14px;
background: rgba(255, 255, 255, 0.7);
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3); box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
transition: opacity 0.2s ease-in-out, left 0.2s ease-in-out, 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; 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) { function _layer(opt) {
var layDom = document.createElement('wc-layer') var layDom = document.createElement('wc-layer')
if (!opt.type) {
opt.type = 'common'
}
if (opt.type === 'toast') { if (opt.type === 'toast') {
var { type, content } = opt var { type, content } = opt
@ -667,8 +672,10 @@ function _layer(opt) {
} }
layDom.props.type = opt.type layDom.props.type = opt.type
layDom.props.fixed = opt.fixed
layDom.props.title = opt.title layDom.props.title = opt.title
if (opt.hasOwnProperty('fixed')) {
layDom.props.fixed = opt.fixed
}
layDom.innerHTML = opt.content layDom.innerHTML = opt.content
layDom.wrapped = false // 用于区分是API创建的还是包裹现有的节点 layDom.wrapped = false // 用于区分是API创建的还是包裹现有的节点