fancyIndex: optimize perforamnce with textContent
Some checks failed
docker-images / multi (push) Has been cancelled

Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
This commit is contained in:
Miao Wang 2025-06-10 19:02:07 +08:00
parent 11404e2b13
commit cc3548ff7a
No known key found for this signature in database
GPG Key ID: B031E3CA7BFED96E

View File

@ -7,7 +7,7 @@ import { createApp } from "vue";
document.getElementById("list").setAttribute("class", "table");
Array.from(document.querySelectorAll("#list tbody tr td:nth-child(3)")).forEach(
(el) => {
const d = new Date(el["innerText"]);
const d = new Date(el["textContent"]);
if (!isNaN(d.getTime())) {
const date_str =
("000" + d.getFullYear()).substr(-4) +
@ -19,7 +19,7 @@ Array.from(document.querySelectorAll("#list tbody tr td:nth-child(3)")).forEach(
("0" + d.getHours()).substr(-2) +
":" +
("0" + d.getMinutes()).substr(-2));
el["innerText"] = date_str;
el["textContent"] = date_str;
}
},
);