Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
traceSourceMb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yanyanhong
traceSourceMb
Commits
4c66a0fb
Commit
4c66a0fb
authored
Dec 17, 2020
by
chenqikuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复选择模板页面我的模板无法正常加载的bug
在选择模板页刷新后我的模板列表是可以正常显示。但是跳转到别的路由再回来,列表就会显示两段相同的内容。
parent
c8393d99
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
template.ts
src/store/modules/template.ts
+2
-1
Index.vue
src/views/selectTemplate/Index.vue
+2
-2
No files found.
src/store/modules/template.ts
View file @
4c66a0fb
...
@@ -34,7 +34,8 @@ const actions = {
...
@@ -34,7 +34,8 @@ const actions = {
const
ids
=
(
results
||
[]).
map
((
folder
:
any
)
=>
folder
.
id
);
const
ids
=
(
results
||
[]).
map
((
folder
:
any
)
=>
folder
.
id
);
try
{
try
{
const
res
=
await
Vue
.
prototype
.
$api
.
template
.
list
({
id
:
ids
});
const
res
=
await
Vue
.
prototype
.
$api
.
template
.
list
({
id
:
ids
});
const
list
=
payload
.
page
!==
undefined
?
state
.
userFolderList
.
concat
(
res
.
results
||
[])
:
(
res
.
results
||
[]
);
const
list
=
(
payload
.
page
===
undefined
||
payload
.
page
===
1
)
?
(
res
.
results
||
[]
)
:
state
.
userFolderList
.
concat
(
res
.
results
||
[])
;
commit
(
'updateUserFolders'
,
list
);
commit
(
'updateUserFolders'
,
list
);
const
isFinished
=
total
<
page_size
;
const
isFinished
=
total
<
page_size
;
return
isFinished
;
return
isFinished
;
...
...
src/views/selectTemplate/Index.vue
View file @
4c66a0fb
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
</div>
</div>
</div>
</div>
<div
v-if=
"isSy"
>
<div
v-if=
"isSy"
>
<van-list
v-model=
"loading"
:finished=
"finished"
@
load=
"onLoad"
ref=
"list"
>
<van-list
v-model=
"loading"
:finished=
"finished"
@
load=
"onLoad"
ref=
"list"
finished-text=
"加载完成"
>
<div
<div
v-for=
"(folder, index) in userFolderList"
v-for=
"(folder, index) in userFolderList"
:key=
"index"
:key=
"index"
...
@@ -106,7 +106,7 @@ export default class SelectTemplate extends Mixins(IndexMixin) {
...
@@ -106,7 +106,7 @@ export default class SelectTemplate extends Mixins(IndexMixin) {
private
loading
=
false
;
private
loading
=
false
;
protected
mounted
()
{
protected
mounted
()
{
// this.getUserFolders
();
this
.
onLoad
();
}
}
private
async
onLoad
()
{
private
async
onLoad
()
{
...
...
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