fix(mixin/hollowoutable): memorized style not correct. by the way disabled hollow out effect on button, because it will delay the transition of backgrounded parent

This commit is contained in:
07akioni 2020-02-27 18:10:56 +08:00
parent 5fddda4912
commit 361f0cbb3a
2 changed files with 11 additions and 7 deletions

View File

@ -211,13 +211,14 @@ export default {
return this.circle || !this.$slots.default return this.circle || !this.$slots.default
}, },
avoidHollowOut () { avoidHollowOut () {
return ( return true
this.text || // return (
this.ghost || // this.text ||
!['primary', 'link', 'info', 'success', 'warning', 'error'].includes( // this.ghost ||
this.type // !['primary', 'link', 'info', 'success', 'warning', 'error'].includes(
) // this.type
) // )
// )
}, },
simulateHollowOut () { simulateHollowOut () {
if (this.ghost) return false if (this.ghost) return false

View File

@ -32,6 +32,9 @@ function getNextBackgroundColorOf (el) {
for (const key of Object.keys(diffedStyle)) { for (const key of Object.keys(diffedStyle)) {
if (~key.indexOf('ransition')) continue if (~key.indexOf('ransition')) continue
memorizedInlineStyle[key] = el.style[key] memorizedInlineStyle[key] = el.style[key]
}
for (const key of Object.keys(diffedStyle)) {
if (~key.indexOf('ransition')) continue
el.style[key] = diffedStyle[key] el.style[key] = diffedStyle[key]
} }
void (el.offsetHeight) void (el.offsetHeight)