提交 | 用户 | 时间
|
23db5e
|
1 |
<template> |
H |
2 |
<el-alert v-if="getEnable()" type="success" show-icon> |
|
3 |
<template #title> |
|
4 |
<div @click="goToUrl">{{ '【' + title + '】文档地址:' + url }}</div> |
|
5 |
</template> |
|
6 |
</el-alert> |
|
7 |
</template> |
|
8 |
<script setup lang="tsx"> |
|
9 |
import { propTypes } from '@/utils/propTypes' |
|
10 |
|
|
11 |
defineOptions({ name: 'DocAlert' }) |
|
12 |
|
|
13 |
const props = defineProps({ |
|
14 |
title: propTypes.string, |
|
15 |
url: propTypes.string |
|
16 |
}) |
|
17 |
|
|
18 |
/** 跳转 URL 链接 */ |
|
19 |
const goToUrl = () => { |
|
20 |
window.open(props.url) |
|
21 |
} |
|
22 |
|
|
23 |
/** 是否开启 */ |
|
24 |
const getEnable = () => { |
|
25 |
return import.meta.env.VITE_APP_DOCALERT_ENABLE !== 'false' |
|
26 |
} |
|
27 |
</script> |
|
28 |
<style scoped> |
|
29 |
.el-alert--success.is-light { |
|
30 |
margin-bottom: 10px; |
|
31 |
cursor: pointer; |
|
32 |
border: 1px solid green; |
|
33 |
} |
|
34 |
</style> |