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 ini from 'highlight.js/lib/languages/ini'
|
||||
import javascript from 'highlight.js/lib/languages/javascript'
|
||||
import { log } from '@/utils/logger'
|
||||
|
||||
const props = defineProps<{
|
||||
code: string
|
||||
@@ -105,7 +106,7 @@ const highlightedCode = computed(() => {
|
||||
result = hljs.highlight(code, { language }).value
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Highlight error:', e)
|
||||
log.error('Highlight error:', e)
|
||||
result = code
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
|
||||
@@ -79,8 +79,6 @@ import {
|
||||
Inbox,
|
||||
AlertCircle,
|
||||
PackageOpen,
|
||||
FolderOpen,
|
||||
Database,
|
||||
Filter
|
||||
} from 'lucide-vue-next'
|
||||
import type { Component } from 'vue'
|
||||
@@ -118,6 +116,11 @@ interface Emits {
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
type: 'default',
|
||||
icon: undefined,
|
||||
title: undefined,
|
||||
description: undefined,
|
||||
actionText: undefined,
|
||||
actionIcon: undefined,
|
||||
actionVariant: 'default',
|
||||
actionSize: 'default',
|
||||
size: 'md',
|
||||
|
||||
@@ -48,6 +48,7 @@ interface Props {
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
variant: 'spinner',
|
||||
message: undefined,
|
||||
size: 'md',
|
||||
fullHeight: false,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user