index.vue 706 B

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