增加可链接外部页面
parent
3861881996
commit
b042bd6052
|
@ -307,5 +307,14 @@ export const page500 = {
|
||||||
component: () => import("@/views/error-page/500.vue")
|
component: () => import("@/views/error-page/500.vue")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const externalLink = {
|
||||||
|
path: "/external-link",
|
||||||
|
meta: {
|
||||||
|
title: "外部链接"
|
||||||
|
},
|
||||||
|
name: "external-link",
|
||||||
|
component: () => import("@/views/external-link/index.vue")
|
||||||
|
};
|
||||||
|
|
||||||
// 所有上面定义的路由都要写在下面的routers里
|
// 所有上面定义的路由都要写在下面的routers里
|
||||||
export const routers = [loginRouter, otherRouter, page500, page403];
|
export const routers = [loginRouter, otherRouter, page500, page403, externalLink];
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
<template>
|
||||||
|
<div class="iframediv">
|
||||||
|
<iframe :src="link" ref="ifram" scrolling="auto" id="ifram"></iframe>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "ExternalLink",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
link: this.$router.currentRoute.name,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
let iframe = document.getElementById("ifram");
|
||||||
|
const deviceWidth = document.body.clientWidth;
|
||||||
|
const deviceHeight = document.body.clientHeight;
|
||||||
|
iframe.style.width = deviceWidth + "px";
|
||||||
|
iframe.style.height = deviceHeight + "px";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
</style>
|
Loading…
Reference in New Issue