Skip to content

Commit

Permalink
修复置顶按钮在手机端异常的bug/兼容代码块里不存在的语言
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry committed Aug 9, 2024
1 parent a7ed0e4 commit 92f429b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion front/components/Memo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ onMounted(() => {
const content = computed(() => {
if (item.value.content && item.value.content.length > 0) {
return md.render(item.value.content)
try{
return md.render(item.value.content)
}catch (e) {
return "内容渲染错误,请重新编辑"
}
}
return ""
})
Expand Down
4 changes: 2 additions & 2 deletions front/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<Footer/>
</div>

<div title="到顶部" v-if="y>200"
class="fixed bottom-[20%] sm:right-[20%] md:right-[10%] lg:right-[15%] xl:right-[20%] 2xl:right-[28%] fixed flex items-center justify-center">
<div title="到顶部" v-if="y>200 && $route.path === '/'"
class="hidden sm:block bottom-[20%] sm:right-[20%] md:right-[10%] lg:right-[15%] xl:right-[20%] 2xl:right-[28%] fixed flex items-center justify-center">
<UIcon name="i-carbon-up-to-top" class="w-12 h-12 text-gray-500 cursor-pointer" @click="y=0"></UIcon>
</div>

Expand Down

0 comments on commit 92f429b

Please sign in to comment.