优化动画逻辑

master
yutent 2023-11-20 11:43:11 +08:00
parent 0be2bf7971
commit 0043895a66
3 changed files with 4 additions and 3 deletions

View File

@ -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",

View File

@ -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, {

View File

@ -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