index.vue 727 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  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. defineOptions({ name: 'DocAlert' })
  11. const props = defineProps({
  12. title: propTypes.string,
  13. url: propTypes.string
  14. })
  15. /** 跳转 URL 链接 */
  16. const goToUrl = () => {
  17. window.open(props.url)
  18. }
  19. /** 是否开启 */
  20. const getEnable = () => {
  21. return import.meta.env.VITE_APP_TENANT_ENABLE === 'true'
  22. }
  23. </script>
  24. <style scoped>
  25. .el-alert--success.is-light {
  26. margin-bottom: 10px;
  27. cursor: pointer;
  28. border: 1px solid green;
  29. }
  30. </style>