You've already forked pure-component
修复 提示条属性修改bug;
This commit is contained in:
9
index.js
9
index.js
@@ -1353,8 +1353,8 @@ class UI {
|
|||||||
}
|
}
|
||||||
} else if (name == 'timeout') {
|
} else if (name == 'timeout') {
|
||||||
this[name] = Number(newValue)
|
this[name] = Number(newValue)
|
||||||
} else {
|
} else if (name == 'type') {
|
||||||
this[name] = newValue
|
this.Tip.className = this.Tip.part = `tip ${newValue}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 初始化
|
// 初始化
|
||||||
@@ -1364,7 +1364,7 @@ class UI {
|
|||||||
const template = document.createElement('template')
|
const template = document.createElement('template')
|
||||||
const style = document.createElement('style')
|
const style = document.createElement('style')
|
||||||
this.Tip = document.createElement('div')
|
this.Tip = document.createElement('div')
|
||||||
this.Tip.className = this.Tip.part = 'tip'
|
this.Tip.className = this.Tip.part = `tip ${type}`
|
||||||
const contentSlot = document.createElement('slot')
|
const contentSlot = document.createElement('slot')
|
||||||
const prefixSlot = document.createElement('slot')
|
const prefixSlot = document.createElement('slot')
|
||||||
contentSlot.name = 'content'
|
contentSlot.name = 'content'
|
||||||
@@ -1432,7 +1432,7 @@ class UI {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
fill: var(--close-color);
|
fill: var(--close-color);
|
||||||
}
|
}
|
||||||
.tip.info {
|
.tip {
|
||||||
background: var(--background-color);
|
background: var(--background-color);
|
||||||
color: var(--color);
|
color: var(--color);
|
||||||
}
|
}
|
||||||
@@ -1455,7 +1455,6 @@ class UI {
|
|||||||
this.hide()
|
this.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Tip.classList.add(type)
|
|
||||||
this.Tip.style.display = hidden ? 'none' : 'flex'
|
this.Tip.style.display = hidden ? 'none' : 'flex'
|
||||||
template.content.appendChild(prefixSlot)
|
template.content.appendChild(prefixSlot)
|
||||||
template.content.appendChild(contentSlot)
|
template.content.appendChild(contentSlot)
|
||||||
|
Reference in New Issue
Block a user