mirror of
https://github.com/tuna/mirror-web.git
synced 2025-12-25 20:32:46 +00:00
fancyIndex: optimize perforamnce with textContent
Some checks failed
docker-images / multi (push) Has been cancelled
Some checks failed
docker-images / multi (push) Has been cancelled
Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
This commit is contained in:
parent
11404e2b13
commit
cc3548ff7a
|
|
@ -7,7 +7,7 @@ import { createApp } from "vue";
|
||||||
document.getElementById("list").setAttribute("class", "table");
|
document.getElementById("list").setAttribute("class", "table");
|
||||||
Array.from(document.querySelectorAll("#list tbody tr td:nth-child(3)")).forEach(
|
Array.from(document.querySelectorAll("#list tbody tr td:nth-child(3)")).forEach(
|
||||||
(el) => {
|
(el) => {
|
||||||
const d = new Date(el["innerText"]);
|
const d = new Date(el["textContent"]);
|
||||||
if (!isNaN(d.getTime())) {
|
if (!isNaN(d.getTime())) {
|
||||||
const date_str =
|
const date_str =
|
||||||
("000" + d.getFullYear()).substr(-4) +
|
("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.getHours()).substr(-2) +
|
||||||
":" +
|
":" +
|
||||||
("0" + d.getMinutes()).substr(-2));
|
("0" + d.getMinutes()).substr(-2));
|
||||||
el["innerText"] = date_str;
|
el["textContent"] = date_str;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue