Skip to content

Commit 92f429b

Browse files
author
Jerry
committed
修复置顶按钮在手机端异常的bug/兼容代码块里不存在的语言
1 parent a7ed0e4 commit 92f429b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

front/components/Memo.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,11 @@ onMounted(() => {
277277
278278
const content = computed(() => {
279279
if (item.value.content && item.value.content.length > 0) {
280-
return md.render(item.value.content)
280+
try{
281+
return md.render(item.value.content)
282+
}catch (e) {
283+
return "内容渲染错误,请重新编辑"
284+
}
281285
}
282286
return ""
283287
})

front/layouts/default.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<Footer/>
55
</div>
66

7-
<div title="到顶部" v-if="y>200"
8-
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">
7+
<div title="到顶部" v-if="y>200 && $route.path === '/'"
8+
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">
99
<UIcon name="i-carbon-up-to-top" class="w-12 h-12 text-gray-500 cursor-pointer" @click="y=0"></UIcon>
1010
</div>
1111

0 commit comments

Comments
 (0)