🐛 修复含有折叠框的文章分享图错误渲染的问题

This commit is contained in:
BTMuli
2023-09-05 11:29:05 +08:00
parent d89bdf2b34
commit b2858899c1

View File

@@ -1,7 +1,7 @@
<template>
<div class="share-box">
<div class="share-btn" @click="shareContent()">
<v-icon> mdi-share-variant </v-icon>
<v-icon> mdi-share-variant</v-icon>
</div>
</div>
</template>
@@ -22,7 +22,21 @@ const emit = defineEmits<TShareBtnEmits>();
async function shareContent(): Promise<void> {
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);
props.modelValue.querySelectorAll("details").forEach((item) => {
if (item.hasAttribute("details-open")) {
item.removeAttribute("details-open");
} else {
item.open = false;
}
});
emit("update:loading", false);
}
</script>