Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
7653610c
提交
7653610c
authored
10月 08, 2020
作者:
陈文彬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix the problem of page blank caused by page refresh
上级
e4c952f3
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
35 行增加
和
54 行删除
+35
-54
LayoutContent.tsx
src/layouts/default/LayoutContent.tsx
+1
-7
index.tsx
src/layouts/page/index.tsx
+31
-25
iframe.ts
src/router/routes/modules/demo/iframe.ts
+2
-0
yarn.lock
yarn.lock
+1
-22
没有找到文件。
src/layouts/default/LayoutContent.tsx
浏览文件 @
7653610c
...
@@ -6,23 +6,17 @@ import { ContentEnum } from '/@/enums/appEnum';
...
@@ -6,23 +6,17 @@ import { ContentEnum } from '/@/enums/appEnum';
import
{
appStore
}
from
'/@/store/modules/app'
;
import
{
appStore
}
from
'/@/store/modules/app'
;
// import { RouterView } from 'vue-router';
// import { RouterView } from 'vue-router';
import
PageLayout
from
'/@/layouts/page/index'
;
import
PageLayout
from
'/@/layouts/page/index'
;
import
FrameLayout
from
'/@/layouts/iframe/index.vue'
;
import
{
useSetting
}
from
'/@/hooks/core/useSetting'
;
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'DefaultLayoutContent'
,
name
:
'DefaultLayoutContent'
,
setup
()
{
setup
()
{
const
{
projectSetting
}
=
useSetting
();
return
()
=>
{
return
()
=>
{
const
{
getProjectConfig
}
=
appStore
;
const
{
getProjectConfig
}
=
appStore
;
const
{
contentMode
}
=
getProjectConfig
;
const
{
contentMode
}
=
getProjectConfig
;
const
wrapClass
=
contentMode
===
ContentEnum
.
FULL
?
'full'
:
'fixed'
;
const
wrapClass
=
contentMode
===
ContentEnum
.
FULL
?
'full'
:
'fixed'
;
return
(
return
(
<
Layout
.
Content
class=
{
`layout-content ${wrapClass} `
}
>
<
Layout
.
Content
class=
{
`layout-content ${wrapClass} `
}
>
{
{
{
{
default
:
()
=>
[<
PageLayout
/>,
projectSetting
.
canEmbedIFramePage
&&
<
FrameLayout
/>]
,
default
:
()
=>
<
PageLayout
/>
,
}
}
}
}
</
Layout
.
Content
>
</
Layout
.
Content
>
);
);
...
...
src/layouts/page/index.tsx
浏览文件 @
7653610c
...
@@ -6,7 +6,9 @@ import { useTransition } from './useTransition';
...
@@ -6,7 +6,9 @@ import { useTransition } from './useTransition';
import
{
RouterView
,
RouteLocation
}
from
'vue-router'
;
import
{
RouterView
,
RouteLocation
}
from
'vue-router'
;
import
{
tabStore
}
from
'/@/store/modules/tab'
;
import
{
tabStore
}
from
'/@/store/modules/tab'
;
import
FrameLayout
from
'/@/layouts/iframe/index.vue'
;
import
{
useSetting
}
from
'/@/hooks/core/useSetting'
;
// import { useRouter } from 'vue-router';
// import { useRouter } from 'vue-router';
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'PageLayout'
,
name
:
'PageLayout'
,
...
@@ -22,6 +24,7 @@ export default defineComponent({
...
@@ -22,6 +24,7 @@ export default defineComponent({
const
{
on
:
transitionOn
}
=
useTransition
();
const
{
on
:
transitionOn
}
=
useTransition
();
on
=
transitionOn
;
on
=
transitionOn
;
}
}
const
{
projectSetting
}
=
useSetting
();
return
()
=>
{
return
()
=>
{
const
{
const
{
routerTransition
,
routerTransition
,
...
@@ -32,32 +35,35 @@ export default defineComponent({
...
@@ -32,32 +35,35 @@ export default defineComponent({
const
openCache
=
openKeepAlive
&&
show
;
const
openCache
=
openKeepAlive
&&
show
;
const
cacheTabs
=
toRaw
(
tabStore
.
getKeepAliveTabsState
)
as
string
[];
const
cacheTabs
=
toRaw
(
tabStore
.
getKeepAliveTabsState
)
as
string
[];
return
[
return
(
<
RouterView
>
<
div
>
{
{
<
RouterView
>
default
:
({
Component
,
route
}:
{
Component
:
any
;
route
:
RouteLocation
})
=>
{
{
{
const
Content
=
openCache
?
(
default
:
({
Component
,
route
}:
{
Component
:
any
;
route
:
RouteLocation
})
=>
{
<
KeepAlive
max=
{
max
}
include=
{
cacheTabs
}
>
const
Content
=
openCache
?
(
<
KeepAlive
max=
{
max
}
include=
{
cacheTabs
}
>
<
Component
{
...
route
.
params
}
/>
</
KeepAlive
>
)
:
(
<
Component
{
...
route
.
params
}
/>
<
Component
{
...
route
.
params
}
/>
</
KeepAlive
>
);
)
:
(
return
openRouterTransition
?
(
<
Component
{
...
route
.
params
}
/>
<
Transition
);
{
...
on
}
return
openRouterTransition
?
(
name=
{
route
.
meta
.
transitionName
||
routerTransition
}
<
Transition
mode=
"out-in"
{
...
on
}
>
name=
{
route
.
meta
.
transitionName
||
routerTransition
}
{
()
=>
Content
}
mode=
"out-in"
</
Transition
>
>
)
:
(
{
()
=>
Content
}
Content
</
Transition
>
);
)
:
(
},
Content
}
}
);
</
RouterView
>
},
{
projectSetting
.
canEmbedIFramePage
&&
<
FrameLayout
/>
}
}
}
</
div
>
</
RouterView
>,
);
];
};
};
},
},
});
});
src/router/routes/modules/demo/iframe.ts
浏览文件 @
7653610c
...
@@ -23,6 +23,7 @@ export default {
...
@@ -23,6 +23,7 @@ export default {
meta
:
{
meta
:
{
frameSrc
:
'https://2x.antdv.com/docs/vue/introduce-cn/'
,
frameSrc
:
'https://2x.antdv.com/docs/vue/introduce-cn/'
,
title
:
'antVue文档(内嵌)'
,
title
:
'antVue文档(内嵌)'
,
afterCloseLoading
:
true
,
},
},
},
},
{
{
...
@@ -32,6 +33,7 @@ export default {
...
@@ -32,6 +33,7 @@ export default {
meta
:
{
meta
:
{
frameSrc
:
'https://vvbin.cn/docs/'
,
frameSrc
:
'https://vvbin.cn/docs/'
,
title
:
'项目文档(内嵌)'
,
title
:
'项目文档(内嵌)'
,
afterCloseLoading
:
true
,
},
},
},
},
{
{
...
...
yarn.lock
浏览文件 @
7653610c
...
@@ -1601,7 +1601,7 @@ cli-cursor@^3.1.0:
...
@@ -1601,7 +1601,7 @@ cli-cursor@^3.1.0:
dependencies:
dependencies:
restore-cursor "^3.1.0"
restore-cursor "^3.1.0"
cli-spinners@^2.2.0
, cli-spinners@^2.4.0
:
cli-spinners@^2.2.0:
version "2.4.0"
version "2.4.0"
resolved "https://registry.npm.taobao.org/cli-spinners/download/cli-spinners-2.4.0.tgz?cache=0&sync_timestamp=1595080377121&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcli-spinners%2Fdownload%2Fcli-spinners-2.4.0.tgz#c6256db216b878cfba4720e719cec7cf72685d7f"
resolved "https://registry.npm.taobao.org/cli-spinners/download/cli-spinners-2.4.0.tgz?cache=0&sync_timestamp=1595080377121&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcli-spinners%2Fdownload%2Fcli-spinners-2.4.0.tgz#c6256db216b878cfba4720e719cec7cf72685d7f"
integrity sha1-xiVtsha4eM+6RyDnGc7Hz3JoXX8=
integrity sha1-xiVtsha4eM+6RyDnGc7Hz3JoXX8=
...
@@ -4821,20 +4821,6 @@ ora@^4.0.4:
...
@@ -4821,20 +4821,6 @@ ora@^4.0.4:
strip-ansi "^6.0.0"
strip-ansi "^6.0.0"
wcwidth "^1.0.1"
wcwidth "^1.0.1"
ora@^5.1.0:
version "5.1.0"
resolved "https://registry.npm.taobao.org/ora/download/ora-5.1.0.tgz?cache=0&sync_timestamp=1599424857800&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fora%2Fdownload%2Fora-5.1.0.tgz#b188cf8cd2d4d9b13fd25383bc3e5cba352c94f8"
integrity sha1-sYjPjNLU2bE/0lODvD5cujUslPg=
dependencies:
chalk "^4.1.0"
cli-cursor "^3.1.0"
cli-spinners "^2.4.0"
is-interactive "^1.0.0"
log-symbols "^4.0.0"
mute-stream "0.0.8"
strip-ansi "^6.0.0"
wcwidth "^1.0.1"
os-tmpdir@~1.0.2:
os-tmpdir@~1.0.2:
version "1.0.2"
version "1.0.2"
resolved "https://registry.npm.taobao.org/os-tmpdir/download/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
resolved "https://registry.npm.taobao.org/os-tmpdir/download/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
...
@@ -6935,13 +6921,6 @@ vfile@^4.0.0:
...
@@ -6935,13 +6921,6 @@ vfile@^4.0.0:
unist-util-stringify-position "^2.0.0"
unist-util-stringify-position "^2.0.0"
vfile-message "^2.0.0"
vfile-message "^2.0.0"
vite-jsx@^1.0.5:
version "1.0.6"
resolved "https://registry.npm.taobao.org/vite-jsx/download/vite-jsx-1.0.6.tgz#5c33b9da6a6562d041418005370a7e3043b0e70c"
integrity sha1-XDO52mplYtBBQYAFNwp+MEOw5ww=
dependencies:
magic-string "^0.25.7"
vite-plugin-mock@^1.0.2:
vite-plugin-mock@^1.0.2:
version "1.0.2"
version "1.0.2"
resolved "https://registry.npm.taobao.org/vite-plugin-mock/download/vite-plugin-mock-1.0.2.tgz#07bdd67a8006fd60a6a83198479f3c0c57c7df53"
resolved "https://registry.npm.taobao.org/vite-plugin-mock/download/vite-plugin-mock-1.0.2.tgz#07bdd67a8006fd60a6a83198479f3c0c57c7df53"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论