Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
feat: 实现iframe功能
Browse files Browse the repository at this point in the history
  • Loading branch information
jinmao88 committed Dec 27, 2023
1 parent 4919137 commit 048e1bf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/admin/src/layout/index.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<script lang="ts" setup>
import { Layout } from '@vben/layouts'
// import { Layout } from '@vben/grid-layouts'
import { computed } from 'vue'
import { useRoute } from 'vue-router'
const frame = computed(() => useRoute().meta.frame)
</script>

<template>
<layout>
<template #main>
<RouterView />
<RouterView v-if="!frame" />
<iframe v-else v-bind="frame" />
</template>
</layout>
</template>
18 changes: 18 additions & 0 deletions packages/router/src/routes/modules/demo/iframe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { LAYOUT } from '../../../routes'
const Iframe: RouteRecordItem = {
path: '/iframe',
name: 'iframe',
component: LAYOUT,
meta: {
orderNo: 6,
title: 'Iframe页面',
icon: 'line-md:document-code',
frame: {
src: 'https://vbenjs.github.io/vben3-doc/',
class: 'h-screen',
width: '80%',
},
},
}

export default Iframe

0 comments on commit 048e1bf

Please sign in to comment.