解决设置 token 绑定的属性时可能有重复值的问题

This commit is contained in:
枫谷剑仙 2022-08-04 22:40:11 +08:00
parent 83abd41ae8
commit 436cac3ef4
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ class CustomTokenList extends Array {
_this.length = 0;
if (_this.#attribute) {
_this.#refreshAttribute = false; //外部属性变化时,添加内容不再循环进行属性的更新
_this.add(..._this.#attribute.nodeValue.split(/\s+/g));
_this.add(...new Set(_this.#attribute.nodeValue.split(/\s+/g)));
_this.#refreshAttribute = true;
}
}