fix: 修复部份 bug (#131)

* fix: 主题模式图标不一致的问题[#125]

* fix: 修复样式问题[#123][#126]

* perf: 优化代码和添加类型
This commit is contained in:
Redon
2023-02-25 22:44:25 +08:00
committed by GitHub
parent 628187f5c3
commit 1406292405
9 changed files with 68 additions and 76 deletions

View File

@@ -2,15 +2,7 @@
import { computed } from 'vue'
import { marked } from 'marked'
import hljs from 'highlight.js'
const props = defineProps<Props>()
marked.setOptions({
renderer: new marked.Renderer(),
highlight(code) {
return hljs.highlightAuto(code).value
},
})
import { useBasicLayout } from '@/hooks/useBasicLayout'
interface Props {
inversion?: boolean
@@ -19,12 +11,23 @@ interface Props {
loading?: boolean
}
const props = defineProps<Props>()
const { isMobile } = useBasicLayout()
marked.setOptions({
renderer: new marked.Renderer(),
highlight(code) {
return hljs.highlightAuto(code).value
},
})
const wrapClass = computed(() => {
return [
'text-wrap',
'p-3',
'min-w-[20px]',
'rounded-md',
isMobile.value ? 'p-2' : 'p-3',
props.inversion ? 'bg-[#d2f9d1]' : 'bg-[#f4f6f8]',
props.inversion ? 'dark:bg-[#a1dc95]' : 'dark:bg-[#1e1e20]',
{ 'text-red-500': props.error },