Update (seo)

Add (lqip)
This commit is contained in:
2023-09-25 02:41:40 +08:00
parent ef9c5a1407
commit 3aa6367e83
20 changed files with 163 additions and 38 deletions

View File

@@ -0,0 +1,25 @@
<template>
<!-- Empty template -->
</template>
<script>
export default {
name: "LqipLoader",
mounted() {
this.initLqipLoading();
},
methods: {
initLqipLoading() {
const imgDefer = document.getElementsByTagName("img");
for (let i = 0; i < imgDefer.length; i++) {
if (imgDefer[i].getAttribute("data-src")) {
imgDefer[i].onload = function () {
this.classList.remove("lqip-blur");
};
imgDefer[i].setAttribute("src", imgDefer[i].getAttribute("data-src"));
}
}
},
},
};
</script>