Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
90b3fab2
Commit
90b3fab2
authored
Nov 08, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: routes with parameters can be cached
parent
cdf2c59e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
8 deletions
+14
-8
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
LayoutContent.tsx
src/layouts/default/LayoutContent.tsx
+8
-5
index.tsx
src/layouts/page/index.tsx
+2
-2
index.vue
src/views/demo/feat/tab-params/index.vue
+3
-1
No files found.
CHANGELOG.zh_CN.md
View file @
90b3fab2
...
...
@@ -6,6 +6,7 @@
-
增加富文本嵌入表单的示例
-
表单组件 schema 增加
`required`
属性。简化配置
-
openModal 和 openDrawer 第二个参数可以代替
`transferModalData`
传参到内部
-
带参路由可以被缓存
### ⚡ Performance Improvements
...
...
src/layouts/default/LayoutContent.tsx
View file @
90b3fab2
import
{
defineComponent
}
from
'
vue
'
;
// import { Layout } from 'ant-design-vue';
import
{
Layout
}
from
'
ant-design-vue
'
;
import
{
RouterView
}
from
'
vue-router
'
;
// hooks
import
{
ContentEnum
}
from
'
/@/enums/appEnum
'
;
import
{
appStore
}
from
'
/@/store/modules/app
'
;
import
PageLayout
from
'
/@/layouts/page/index
'
;
//
import PageLayout from '/@/layouts/page/index';
export
default
defineComponent
({
name
:
'
DefaultLayoutContent
'
,
setup
()
{
...
...
@@ -13,9 +15,10 @@ export default defineComponent({
const
{
contentMode
}
=
getProjectConfig
;
const
wrapClass
=
contentMode
===
ContentEnum
.
FULL
?
'
full
'
:
'
fixed
'
;
return
(
// <Layout.Content class={`layout-content ${wrapClass} `}>
<
PageLayout
class=
{
`layout-content ${wrapClass} `
}
/>
// </Layout.Content>
<
Layout
.
Content
class=
{
`layout-content ${wrapClass} `
}
>
{
()
=>
<
RouterView
/>
}
{
/* <PageLayout class={`layout-content ${wrapClass} `} /> */
}
</
Layout
.
Content
>
);
};
},
...
...
src/layouts/page/index.tsx
View file @
90b3fab2
...
...
@@ -44,10 +44,10 @@ export default defineComponent({
// TODO add key?
const
Content
=
openCache
?
(
<
KeepAlive
max=
{
max
}
include=
{
cacheTabs
}
>
<
Component
/>
<
Component
key=
{
route
.
path
}
/>
</
KeepAlive
>
)
:
(
<
Component
/>
<
Component
key=
{
route
.
path
}
/>
);
return
openRouterTransition
?
(
<
Transition
...
...
src/views/demo/feat/tab-params/index.vue
View file @
90b3fab2
<
template
>
<div
class=
"p-4"
>
Current Param :
{{
params
}}
<!--
<input
/>
-->
<br
/>
Keep Alive
<input
/>
</div>
</
template
>
<
script
lang=
"ts"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment