Skip to content

Commit

Permalink
🐛 修复含有折叠框的文章分享图错误渲染的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
BTMuli committed Sep 5, 2023
1 parent d89bdf2 commit b285889
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/components/main/t-shareBtn.vue
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -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>
Expand Down

0 comments on commit b285889

Please sign in to comment.