2025-04-05 17:09:16 +08:00
|
|
|
|
<script lang="ts" setup>
|
2025-04-22 21:18:10 +08:00
|
|
|
|
import { isDocAlertEnable } from '@vben/hooks';
|
2025-05-06 21:39:25 +08:00
|
|
|
|
import { openWindow } from '@vben/utils';
|
2025-04-22 21:18:10 +08:00
|
|
|
|
|
2025-04-05 17:09:16 +08:00
|
|
|
|
import { Alert, Typography } from 'ant-design-vue';
|
|
|
|
|
|
|
|
|
|
|
|
export interface DocAlertProps {
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 文档标题
|
|
|
|
|
|
*/
|
|
|
|
|
|
title: string;
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 文档 URL 地址
|
|
|
|
|
|
*/
|
|
|
|
|
|
url: string;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps<DocAlertProps>();
|
|
|
|
|
|
|
|
|
|
|
|
/** 跳转 URL 链接 */
|
|
|
|
|
|
const goToUrl = () => {
|
2025-05-06 21:39:25 +08:00
|
|
|
|
openWindow(props.url);
|
2025-04-05 17:09:16 +08:00
|
|
|
|
};
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
2025-04-22 22:10:33 +08:00
|
|
|
|
<Alert v-if="isDocAlertEnable()" type="info" show-icon class="mb-2 rounded">
|
2025-04-05 17:09:16 +08:00
|
|
|
|
<template #message>
|
|
|
|
|
|
<Typography.Link @click="goToUrl">
|
|
|
|
|
|
【{{ title }}】文档地址:{{ url }}
|
|
|
|
|
|
</Typography.Link>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</Alert>
|
|
|
|
|
|
</template>
|