优化layer默认配置
parent
c36ea5509b
commit
8b879257f4
|
@ -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创建的还是包裹现有的节点
|
||||||
|
|
Reference in New Issue