feat: 内嵌页面
This commit is contained in:
parent
3ae0c6ed19
commit
3e8bfd7aba
1
src/components.d.ts
vendored
1
src/components.d.ts
vendored
@ -11,6 +11,7 @@ declare module 'vue' {
|
|||||||
CodeView: typeof import('./components/code-view/index.vue')['default']
|
CodeView: typeof import('./components/code-view/index.vue')['default']
|
||||||
ExternalLinkPage: typeof import('./components/external-link-page/index.vue')['default']
|
ExternalLinkPage: typeof import('./components/external-link-page/index.vue')['default']
|
||||||
FillPage: typeof import('./components/fill-page/index.vue')['default']
|
FillPage: typeof import('./components/fill-page/index.vue')['default']
|
||||||
|
InternalLinkPage: typeof import('./components/internal-link-page/index.vue')['default']
|
||||||
LangProvider: typeof import('./components/lang-provider/index.vue')['default']
|
LangProvider: typeof import('./components/lang-provider/index.vue')['default']
|
||||||
MainTransition: typeof import('./components/main-transition/index.vue')['default']
|
MainTransition: typeof import('./components/main-transition/index.vue')['default']
|
||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<FillPage>
|
<FillPage>
|
||||||
<div class="external-link-page">
|
<div class="external-link-page">
|
||||||
|
<div class="external-link-inner-page">
|
||||||
<div>
|
<div>
|
||||||
<div class="star-emoji">🌍</div>
|
<div class="star-emoji">🌍</div>
|
||||||
<div class="docs-text">外链页面已经在新窗口中打开</div>
|
<div class="docs-text">外链页面已经在新窗口中打开</div>
|
||||||
<div class="to-page"><a-button type="primary" @click="openPage">立即前往</a-button></div>
|
<div class="to-page"><a-button type="primary" @click="openPage">立即前往</a-button></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</FillPage>
|
</FillPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -21,6 +23,13 @@ const openPage = () => {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.external-link-page {
|
.external-link-page {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: $padding;
|
||||||
|
|
||||||
|
.external-link-inner-page {
|
||||||
|
height: 100%;
|
||||||
|
background: $color-bg-1;
|
||||||
|
overflow: hidden;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -39,4 +48,5 @@ const openPage = () => {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -5,10 +5,8 @@
|
|||||||
height: viewportHeight
|
height: viewportHeight
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div class="fill-page-inner">
|
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -26,6 +24,9 @@ const viewportHeight = computed(() => {
|
|||||||
} else if (!isTabs.value && isFooter.value) {
|
} else if (!isTabs.value && isFooter.value) {
|
||||||
// 无tabs,有footer
|
// 无tabs,有footer
|
||||||
return `calc(100vh - 60px - 30px)`;
|
return `calc(100vh - 60px - 30px)`;
|
||||||
|
} else if (isTabs.value && !isFooter.value) {
|
||||||
|
// 有tabs,无footer
|
||||||
|
return `calc(100vh - 60px - 40px)`;
|
||||||
} else {
|
} else {
|
||||||
// 无tabs、无footer,直接减去顶部head
|
// 无tabs、无footer,直接减去顶部head
|
||||||
return `calc(100vh - 60px)`;
|
return `calc(100vh - 60px)`;
|
||||||
@ -35,14 +36,7 @@ const viewportHeight = computed(() => {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.fill-page-size {
|
.fill-page-size {
|
||||||
padding: $padding;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
// box-shadow: $shadow-border-1;
|
||||||
.fill-page-inner {
|
|
||||||
height: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: $padding;
|
|
||||||
background: $color-bg-1;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
23
src/components/internal-link-page/index.vue
Normal file
23
src/components/internal-link-page/index.vue
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<template>
|
||||||
|
<FillPage>
|
||||||
|
<iframe :src="link" class="iframe-size"> </iframe>
|
||||||
|
</FillPage>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
|
const link = ref<string>(route.meta.link as string);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.iframe-size {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: absolute; // 设置绝对定位,解决边框滚动条显示问题
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -24,8 +24,15 @@ export default {
|
|||||||
["userinfo"]: "userinfo",
|
["userinfo"]: "userinfo",
|
||||||
["user-settings"]: "user settings",
|
["user-settings"]: "user settings",
|
||||||
["external-links"]: "external links",
|
["external-links"]: "external links",
|
||||||
["link-gitee"]: "link gitee",
|
["inline-page"]: "inline page",
|
||||||
["link-juejin"]: "link juejin",
|
["uigradients"]: "uigradients",
|
||||||
|
["color-taking-tool"]: "color taking tool",
|
||||||
|
["grid-generator"]: "grid generator",
|
||||||
|
["vue-official-website"]: "vue",
|
||||||
|
["vite-official-website"]: "vite",
|
||||||
|
["external-page"]: "external link page",
|
||||||
|
["link-gitee"]: "gitee",
|
||||||
|
["link-juejin"]: "juejin",
|
||||||
["about-project"]: "about project",
|
["about-project"]: "about project",
|
||||||
["not-power"]: "No permission",
|
["not-power"]: "No permission",
|
||||||
["not-found"]: "Page not found",
|
["not-found"]: "Page not found",
|
||||||
|
|||||||
@ -25,6 +25,13 @@ export default {
|
|||||||
["user-settings"]: "用户设置",
|
["user-settings"]: "用户设置",
|
||||||
["about-project"]: "关于项目",
|
["about-project"]: "关于项目",
|
||||||
["external-links"]: "外部链接",
|
["external-links"]: "外部链接",
|
||||||
|
["inline-page"]: "内嵌页面",
|
||||||
|
["uigradients"]: "渐变配色",
|
||||||
|
["color-taking-tool"]: "取色工具",
|
||||||
|
["grid-generator"]: "网格生成器",
|
||||||
|
["vue-official-website"]: "vue官网",
|
||||||
|
["vite-official-website"]: "vite官网",
|
||||||
|
["external-page"]: "外链页面",
|
||||||
["link-gitee"]: "外链 gitee",
|
["link-gitee"]: "外链 gitee",
|
||||||
["link-juejin"]: "外链 掘金",
|
["link-juejin"]: "外链 掘金",
|
||||||
["not-power"]: "没有权限",
|
["not-power"]: "没有权限",
|
||||||
|
|||||||
@ -291,7 +291,7 @@ export const dynamicRoutes: RouteRecordRaw[] = [
|
|||||||
{
|
{
|
||||||
path: "/external-links",
|
path: "/external-links",
|
||||||
name: "external-links",
|
name: "external-links",
|
||||||
redirect: "/external-links/link-gitee",
|
redirect: "/external-links/inline-page",
|
||||||
meta: {
|
meta: {
|
||||||
title: "external-links",
|
title: "external-links",
|
||||||
hide: false,
|
hide: false,
|
||||||
@ -304,9 +304,121 @@ export const dynamicRoutes: RouteRecordRaw[] = [
|
|||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: "/external-links/link-gitee",
|
path: "/external-links/inline-page",
|
||||||
|
name: "inline-page",
|
||||||
|
redirect: "/external-links/inline-page/vue-official-website",
|
||||||
|
meta: {
|
||||||
|
title: "inline-page",
|
||||||
|
hide: false,
|
||||||
|
keepAlive: true,
|
||||||
|
affix: false,
|
||||||
|
link: "",
|
||||||
|
iframe: false,
|
||||||
|
roles: ["admin"],
|
||||||
|
icon: "icon-menu"
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "/external-links/inline-page/uigradients",
|
||||||
|
name: "uigradients",
|
||||||
|
component: () => import("@/views/external-links/inline-page/inline-page.vue"),
|
||||||
|
meta: {
|
||||||
|
title: "uigradients",
|
||||||
|
hide: false,
|
||||||
|
keepAlive: true,
|
||||||
|
affix: false,
|
||||||
|
link: "https://uigradients.com/#HoneyDew", // 链接
|
||||||
|
iframe: true, // 区分是否内链 true内链 false外链
|
||||||
|
roles: ["admin"],
|
||||||
|
icon: "icon-menu"
|
||||||
|
},
|
||||||
|
children: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/external-links/inline-page/color-taking-tool",
|
||||||
|
name: "color-taking-tool",
|
||||||
|
component: () => import("@/views/external-links/inline-page/inline-page.vue"),
|
||||||
|
meta: {
|
||||||
|
title: "color-taking-tool",
|
||||||
|
hide: false,
|
||||||
|
keepAlive: true,
|
||||||
|
affix: false,
|
||||||
|
link: "https://photokit.com/colors/eyedropper/?lang=zh", // 链接
|
||||||
|
iframe: true, // 区分是否内链 true内链 false外链
|
||||||
|
roles: ["admin"],
|
||||||
|
icon: "icon-menu"
|
||||||
|
},
|
||||||
|
children: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/external-links/inline-page/grid-generator",
|
||||||
|
name: "grid-generator",
|
||||||
|
component: () => import("@/views/external-links/inline-page/inline-page.vue"),
|
||||||
|
meta: {
|
||||||
|
title: "grid-generator",
|
||||||
|
hide: false,
|
||||||
|
keepAlive: true,
|
||||||
|
affix: false,
|
||||||
|
link: "https://cssgrid-generator.netlify.app/", // 链接
|
||||||
|
iframe: true, // 区分是否内链 true内链 false外链
|
||||||
|
roles: ["admin"],
|
||||||
|
icon: "icon-menu"
|
||||||
|
},
|
||||||
|
children: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/external-links/inline-page/vue-official-website",
|
||||||
|
name: "vue-official-website",
|
||||||
|
component: () => import("@/views/external-links/inline-page/inline-page.vue"),
|
||||||
|
meta: {
|
||||||
|
title: "vue-official-website",
|
||||||
|
hide: false,
|
||||||
|
keepAlive: true,
|
||||||
|
affix: false,
|
||||||
|
link: "https://cn.vuejs.org/", // 链接
|
||||||
|
iframe: true, // 区分是否内链 true内链 false外链
|
||||||
|
roles: ["admin"],
|
||||||
|
icon: "icon-menu"
|
||||||
|
},
|
||||||
|
children: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/external-links/inline-page/vite-official-website",
|
||||||
|
name: "vite-official-website",
|
||||||
|
component: () => import("@/views/external-links/inline-page/inline-page.vue"),
|
||||||
|
meta: {
|
||||||
|
title: "vite-official-website",
|
||||||
|
hide: false,
|
||||||
|
keepAlive: true,
|
||||||
|
affix: false,
|
||||||
|
link: "https://www.vitejs.net/", // 链接
|
||||||
|
iframe: true, // 区分是否内链 true内链 false外链
|
||||||
|
roles: ["admin"],
|
||||||
|
icon: "icon-menu"
|
||||||
|
},
|
||||||
|
children: []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/external-links/external-page",
|
||||||
|
name: "external-page",
|
||||||
|
redirect: "/external-links/external-page/link-gitee",
|
||||||
|
meta: {
|
||||||
|
title: "external-page",
|
||||||
|
hide: false,
|
||||||
|
keepAlive: true,
|
||||||
|
affix: false,
|
||||||
|
link: "",
|
||||||
|
iframe: false,
|
||||||
|
roles: ["admin"],
|
||||||
|
icon: "icon-menu"
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "/external-links/external-page/link-gitee",
|
||||||
name: "link-gitee",
|
name: "link-gitee",
|
||||||
component: () => import("@/views/external-links/link-gitee/link-gitee.vue"),
|
component: () => import("@/views/external-links/external-page/external-page.vue"),
|
||||||
meta: {
|
meta: {
|
||||||
title: "link-gitee",
|
title: "link-gitee",
|
||||||
hide: false,
|
hide: false,
|
||||||
@ -320,9 +432,9 @@ export const dynamicRoutes: RouteRecordRaw[] = [
|
|||||||
children: []
|
children: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/external-links/link-juejin",
|
path: "/external-links/external-page/link-juejin",
|
||||||
name: "link-juejin",
|
name: "link-juejin",
|
||||||
component: () => import("@/views/external-links/link-juejin/link-juejin.vue"),
|
component: () => import("@/views/external-links/external-page/external-page.vue"),
|
||||||
meta: {
|
meta: {
|
||||||
title: "link-juejin",
|
title: "link-juejin",
|
||||||
hide: false,
|
hide: false,
|
||||||
@ -336,6 +448,8 @@ export const dynamicRoutes: RouteRecordRaw[] = [
|
|||||||
children: []
|
children: []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/internationalization",
|
path: "/internationalization",
|
||||||
|
|||||||
3
src/views/external-links/inline-page/inline-page.vue
Normal file
3
src/views/external-links/inline-page/inline-page.vue
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<template>
|
||||||
|
<InternalLinkPage />
|
||||||
|
</template>
|
||||||
@ -1,3 +0,0 @@
|
|||||||
<template>
|
|
||||||
<ExternalLinkPage />
|
|
||||||
</template>
|
|
||||||
@ -58,7 +58,7 @@ const rules = {
|
|||||||
|
|
||||||
const onSubmit = ({ errors }: ArcoDesign.ArcoSubmit) => {
|
const onSubmit = ({ errors }: ArcoDesign.ArcoSubmit) => {
|
||||||
if (errors) return;
|
if (errors) return;
|
||||||
proxy.$message.success("修改基本信息");
|
proxy.$message.success("修改安全设置");
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user