Sync source to CNB / Sync Git ref (push) Skipped
- 新增 WikiView 页面:输入标题加载页面,支持内部词条跳转与返回栈 - 新增 WikiNodeRenderer 递归渲染器:标题、段落、加粗斜体下划线删除线、高亮、行内代码、黑幕、分隔线、内外链、有序无序列表、引用、代码块、表格、附件、提示块 - 新增 WikiNotice 提示块与 WikiAttachmentNode 附件组件,图片支持点击查看大图 - 补充维基节点与附件类型定义,新增附件查询接口与附件内容 URL 拼接 - 主页导航 Wiki 卡片改为站内打开 - 中英文各补 10 个文案
33 lines
784 B
Vue
33 lines
784 B
Vue
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
|
|
const props = defineProps<{
|
|
title: string
|
|
description?: string | null
|
|
variant?: string | null
|
|
}>()
|
|
|
|
const variantClass = computed(() => {
|
|
switch (props.variant) {
|
|
case 'warning':
|
|
return 'border-yellow/40 bg-yellow/10 text-yellow'
|
|
case 'error':
|
|
return 'border-red/40 bg-red/10 text-red'
|
|
case 'success':
|
|
return 'border-green/40 bg-green/10 text-green'
|
|
default:
|
|
return 'border-brand/40 bg-brand/10 text-brand'
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<div class="my-4 rounded-lg border border-solid p-4" :class="variantClass">
|
|
<p class="m-0 text-sm font-bold">{{ title }}</p>
|
|
<p v-if="description" class="m-0 mt-1 text-xs whitespace-pre-wrap opacity-90">
|
|
{{ description }}
|
|
</p>
|
|
<slot />
|
|
</div>
|
|
</template>
|