File tree 4 files changed +14
-8
lines changed
views/demo/feat/tab-params
4 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 6
6
- 增加富文本嵌入表单的示例
7
7
- 表单组件 schema 增加 ` required ` 属性。简化配置
8
8
- openModal 和 openDrawer 第二个参数可以代替` transferModalData ` 传参到内部
9
+ - 带参路由可以被缓存
9
10
10
11
### ⚡ Performance Improvements
11
12
Original file line number Diff line number Diff line change 1
1
import { defineComponent } from 'vue' ;
2
- // import { Layout } from 'ant-design-vue';
2
+ import { Layout } from 'ant-design-vue' ;
3
+ import { RouterView } from 'vue-router' ;
4
+
3
5
// hooks
4
6
5
7
import { ContentEnum } from '/@/enums/appEnum' ;
6
8
import { appStore } from '/@/store/modules/app' ;
7
- import PageLayout from '/@/layouts/page/index' ;
9
+ // import PageLayout from '/@/layouts/page/index';
8
10
export default defineComponent ( {
9
11
name : 'DefaultLayoutContent' ,
10
12
setup ( ) {
@@ -13,9 +15,10 @@ export default defineComponent({
13
15
const { contentMode } = getProjectConfig ;
14
16
const wrapClass = contentMode === ContentEnum . FULL ? 'full' : 'fixed' ;
15
17
return (
16
- // <Layout.Content class={`layout-content ${wrapClass} `}>
17
- < PageLayout class = { `layout-content ${ wrapClass } ` } />
18
- // </Layout.Content>
18
+ < Layout . Content class = { `layout-content ${ wrapClass } ` } >
19
+ { ( ) => < RouterView /> }
20
+ { /* <PageLayout class={`layout-content ${wrapClass} `} /> */ }
21
+ </ Layout . Content >
19
22
) ;
20
23
} ;
21
24
} ,
Original file line number Diff line number Diff line change @@ -44,10 +44,10 @@ export default defineComponent({
44
44
// TODO add key?
45
45
const Content = openCache ? (
46
46
< KeepAlive max = { max } include = { cacheTabs } >
47
- < Component />
47
+ < Component key = { route . path } />
48
48
</ KeepAlive >
49
49
) : (
50
- < Component />
50
+ < Component key = { route . path } />
51
51
) ;
52
52
return openRouterTransition ? (
53
53
< Transition
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" p-4" >
3
3
Current Param : {{ params }}
4
- <!-- <input /> -->
4
+ <br />
5
+ Keep Alive
6
+ <input />
5
7
</div >
6
8
</template >
7
9
<script lang="ts">
You can’t perform that action at this time.
0 commit comments