代码微调

This commit is contained in:
枫谷剑仙 2021-10-06 00:36:07 +08:00
parent dc01694d47
commit 5e14d7c547
1 changed files with 2 additions and 2 deletions

View File

@ -155,12 +155,12 @@ function tp(strings, ...keys) {
//console.debug("模板字符串中 %s 未找到输入数据",key);
}else
{
if (!(value instanceof Node))
if (!(value instanceof HTMLElement))
{
value = document.createTextNode(value);
}
try{
fragment.appendChild(arr.lastIndexOf(key) == i ? value : value.cloneNode(true));
fragment.appendChild(arr.lastIndexOf(key) === i ? value : value.cloneNode(true)); //如果是最后一个匹配的标签就插入原始的DOM保留行为否则插入克隆的DOM
}catch(e)
{
console.log(value, e);