index.vue 749 B

12345678910111213141516171819202122232425262728
  1. <template>
  2. <!-- <doc-alert title="数据库 MyBatis" url="https://doc.iocoder.cn/mybatis/" />
  3. <doc-alert title="多数据源(读写分离)" url="https://doc.iocoder.cn/dynamic-datasource/" /> -->
  4. <ContentWrap>
  5. <IFrame v-if="!loading" :src="url" />
  6. </ContentWrap>
  7. </template>
  8. <script lang="ts" setup>
  9. import * as ConfigApi from '@/api/infra/config'
  10. defineOptions({ name: 'InfraDruid' })
  11. const loading = ref(true) // 是否加载中
  12. const url = ref(import.meta.env.VITE_BASE_URL + '/druid/index.html')
  13. /** 初始化 */
  14. onMounted(async () => {
  15. try {
  16. const data = await ConfigApi.getConfigKey('url.druid')
  17. if (data && data.length > 0) {
  18. url.value = data
  19. }
  20. } finally {
  21. loading.value = false
  22. }
  23. })
  24. </script>