Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
beyond-clouds-front
Commits
7dc95d67
Commit
7dc95d67
authored
Apr 12, 2020
by
yanju
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务端渲染一级栏目
parent
4d16de0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
27 deletions
+32
-27
components/pc/nav/navCard.vue
+1
-0
pages/blog/index.vue
+31
-27
No files found.
components/pc/nav/navCard.vue
View file @
7dc95d67
...
@@ -74,6 +74,7 @@
...
@@ -74,6 +74,7 @@
},
},
watch
:{
watch
:{
$route
(
to
,
from
){
$route
(
to
,
from
){
this
.
type
=
this
.
$route
.
query
.
type
this
.
type
=
this
.
$route
.
query
.
type
...
...
pages/blog/index.vue
View file @
7dc95d67
...
@@ -110,34 +110,38 @@ export default {
...
@@ -110,34 +110,38 @@ export default {
this
.
pages
=
this
.
articlePages
;
this
.
pages
=
this
.
articlePages
;
},
},
async
dataGetBlogCategory
(){
dataGetBlogCategory
(){
for
(
const
val
of
this
.
typeList
){
this
.
typeList
.
map
((
val
)
=>
{
if
(
!
val
.
leaf
){
if
(
!
val
.
leaf
){
let
childListData
=
await
this
.
$axios
.
$get
(
config
.
api
.
get
.
BlogCategory
.
childList
+
val
.
categoryId
+
'/categories'
)
this
.
list
.
push
({
let
childList
=
[];
label
:
val
.
category
,
childListData
.
data
.
map
((
val
,
index
)
=>
{
address
:
'/blog'
,
childList
.
push
({
type
:
val
.
categoryId
.
toString
(),
label
:
val
.
category
,
childList
:[]
address
:
'/blog'
,
})
childId
:
val
.
categoryId
.
toString
(),
}
else
{
})
this
.
list
.
push
({
})
label
:
val
.
category
,
this
.
list
.
push
({
address
:
'/blog'
,
label
:
val
.
category
,
type
:
val
.
categoryId
.
toString
(),
address
:
'/blog'
,
})
type
:
val
.
categoryId
.
toString
(),
}
childList
})
}
else
{
await
this
.
list
.
push
({
label
:
val
.
category
,
address
:
'/blog'
,
type
:
val
.
categoryId
.
toString
(),
})
}
}
})
this
.
typeList
.
map
(
async
(
val
,
index
)
=>
{
if
(
!
val
.
leaf
){
let
childListData
=
await
this
.
$axios
.
$get
(
config
.
api
.
get
.
BlogCategory
.
childList
+
val
.
categoryId
+
'/categories'
)
let
childList
=
[];
childListData
.
data
.
map
((
val
,
index
)
=>
{
childList
.
push
({
label
:
val
.
category
,
address
:
'/blog'
,
childId
:
val
.
categoryId
.
toString
(),
})
})
this
.
list
[
index
+
1
].
childList
=
childList
}
})
},
},
getLabelTitle
(){
getLabelTitle
(){
...
...
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