admin-vben/apps/web-antd/src/components/doc-alert/doc-alert.vue

34 lines
663 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<script lang="ts" setup>
import { isDocAlertEnable } from '@vben/hooks';
import { Alert, Typography } from 'ant-design-vue';
export interface DocAlertProps {
/**
* 文档标题
*/
title: string;
/**
* 文档 URL 地址
*/
url: string;
}
const props = defineProps<DocAlertProps>();
/** 跳转 URL 链接 */
const goToUrl = () => {
window.open(props.url);
};
</script>
<template>
<Alert v-if="isDocAlertEnable()" type="info" show-icon class="mb-2 rounded">
<template #message>
<Typography.Link @click="goToUrl">
{{ title }}{{ url }}
</Typography.Link>
</template>
</Alert>
</template>