mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
🐛 修复含有折叠框的文章分享图错误渲染的问题
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="share-box">
|
<div class="share-box">
|
||||||
<div class="share-btn" @click="shareContent()">
|
<div class="share-btn" @click="shareContent()">
|
||||||
<v-icon> mdi-share-variant </v-icon>
|
<v-icon> mdi-share-variant</v-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -22,7 +22,21 @@ const emit = defineEmits<TShareBtnEmits>();
|
|||||||
|
|
||||||
async function shareContent(): Promise<void> {
|
async function shareContent(): Promise<void> {
|
||||||
emit("update:loading", true);
|
emit("update:loading", true);
|
||||||
|
props.modelValue.querySelectorAll("details").forEach((item) => {
|
||||||
|
if (item.open) {
|
||||||
|
item.setAttribute("details-open", "");
|
||||||
|
} else {
|
||||||
|
item.open = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
await generateShareImg(props.title, props.modelValue);
|
await generateShareImg(props.title, props.modelValue);
|
||||||
|
props.modelValue.querySelectorAll("details").forEach((item) => {
|
||||||
|
if (item.hasAttribute("details-open")) {
|
||||||
|
item.removeAttribute("details-open");
|
||||||
|
} else {
|
||||||
|
item.open = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
emit("update:loading", false);
|
emit("update:loading", false);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user