优化动画逻辑
parent
0be2bf7971
commit
0043895a66
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "wkit",
|
||||
"version": "1.10.12",
|
||||
"version": "1.10.13",
|
||||
"type": "module",
|
||||
"description": "A library for building fast, lightweight web components.",
|
||||
"main": "dist/index.js",
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
export function animate(duration = 200, fromto = [], out = false) {
|
||||
if (out === false) {
|
||||
if (out === false && this.style.display === 'none') {
|
||||
this.style.display = ''
|
||||
}
|
||||
let res = this.animate(fromto, {
|
||||
|
|
|
@ -140,6 +140,7 @@ function getTemplateHtml(strings, type) {
|
|||
}
|
||||
return [htmlResult, attrNames]
|
||||
}
|
||||
|
||||
class Template {
|
||||
constructor({ strings, ['__dom_type__']: type }, options) {
|
||||
this.parts = []
|
||||
|
@ -480,7 +481,7 @@ class AttributePart {
|
|||
this.$parent = parent
|
||||
this.options = options
|
||||
if (strings.length > 2 || strings[0] !== '' || strings[1] !== '') {
|
||||
this._$committedValue = new Array(strings.length - 1).fill(new String())
|
||||
this._$committedValue = new Array(strings.length - 1).fill('')
|
||||
this.strings = strings
|
||||
} else {
|
||||
this._$committedValue = NOTHING
|
||||
|
|
Loading…
Reference in New Issue