From 0043895a669e4520612bca7f0b66cca57ab29106 Mon Sep 17 00:00:00 2001 From: yutent Date: Mon, 20 Nov 2023 11:43:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8A=A8=E7=94=BB=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/anim.js | 2 +- src/html.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2b62b94..89b2dde 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/anim.js b/src/anim.js index 134101f..bd709bf 100644 --- a/src/anim.js +++ b/src/anim.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, { diff --git a/src/html.js b/src/html.js index 32cb201..ab13130 100644 --- a/src/html.js +++ b/src/html.js @@ -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