feat: add dco alert comp

pull/99/head^2
xingyu4j 2025-05-09 14:37:18 +08:00
parent 0e326a1e57
commit 88c8447840
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,32 @@
<script lang="ts" setup>
import { isDocAlertEnable } from '@vben/hooks';
import { openWindow } from '@vben/utils';
import { NAlert, NText } from 'naive-ui';
export interface DocAlertProps {
/**
* 文档标题
*/
title: string;
/**
* 文档 URL 地址
*/
url: string;
}
const props = defineProps<DocAlertProps>();
/** 跳转 URL 链接 */
const goToUrl = () => {
openWindow(props.url);
};
</script>
<template>
<NAlert v-if="isDocAlertEnable()" type="info" show-icon class="mb-2 rounded">
<template #message>
<NText @click="goToUrl"> {{ title }}{{ url }} </NText>
</template>
</NAlert>
</template>

View File

@ -0,0 +1 @@
export { default as DocAlert } from './doc-alert.vue';