mirror of
https://github.com/fawney19/Aether.git
synced 2026-01-03 00:02:28 +08:00
refactor(frontend): 优化公共组件
- 改进 EmptyState 和 LoadingState 组件 - 优化 CodeHighlight 样式和功能
This commit is contained in:
@@ -14,6 +14,7 @@ import bash from 'highlight.js/lib/languages/bash'
|
|||||||
import json from 'highlight.js/lib/languages/json'
|
import json from 'highlight.js/lib/languages/json'
|
||||||
import ini from 'highlight.js/lib/languages/ini'
|
import ini from 'highlight.js/lib/languages/ini'
|
||||||
import javascript from 'highlight.js/lib/languages/javascript'
|
import javascript from 'highlight.js/lib/languages/javascript'
|
||||||
|
import { log } from '@/utils/logger'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
code: string
|
code: string
|
||||||
@@ -105,7 +106,7 @@ const highlightedCode = computed(() => {
|
|||||||
result = hljs.highlight(code, { language }).value
|
result = hljs.highlight(code, { language }).value
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Highlight error:', e)
|
log.error('Highlight error:', e)
|
||||||
result = code
|
result = code
|
||||||
.replace(/&/g, '&')
|
.replace(/&/g, '&')
|
||||||
.replace(/</g, '<')
|
.replace(/</g, '<')
|
||||||
|
|||||||
@@ -79,8 +79,6 @@ import {
|
|||||||
Inbox,
|
Inbox,
|
||||||
AlertCircle,
|
AlertCircle,
|
||||||
PackageOpen,
|
PackageOpen,
|
||||||
FolderOpen,
|
|
||||||
Database,
|
|
||||||
Filter
|
Filter
|
||||||
} from 'lucide-vue-next'
|
} from 'lucide-vue-next'
|
||||||
import type { Component } from 'vue'
|
import type { Component } from 'vue'
|
||||||
@@ -118,6 +116,11 @@ interface Emits {
|
|||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
type: 'default',
|
type: 'default',
|
||||||
|
icon: undefined,
|
||||||
|
title: undefined,
|
||||||
|
description: undefined,
|
||||||
|
actionText: undefined,
|
||||||
|
actionIcon: undefined,
|
||||||
actionVariant: 'default',
|
actionVariant: 'default',
|
||||||
actionSize: 'default',
|
actionSize: 'default',
|
||||||
size: 'md',
|
size: 'md',
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ interface Props {
|
|||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
variant: 'spinner',
|
variant: 'spinner',
|
||||||
|
message: undefined,
|
||||||
size: 'md',
|
size: 'md',
|
||||||
fullHeight: false,
|
fullHeight: false,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user