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
1aaafe72
Commit
1aaafe72
authored
Apr 09, 2020
by
yanju
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
博客获取子分类
parent
709fd648
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
action/config.js
+1
-0
components/pc/nav/navCard.vue
+1
-2
pages/blog/index.vue
+20
-1
No files found.
action/config.js
View file @
1aaafe72
...
@@ -35,6 +35,7 @@ export default {
...
@@ -35,6 +35,7 @@ export default {
},
},
BlogCategory
:{
BlogCategory
:{
list
:
'/api/blog/categories'
,
//获取项目分类列表
list
:
'/api/blog/categories'
,
//获取项目分类列表
childList
:
'/api/blog/'
,
//获取项目分类列表 + {categoryId}/categories
},
},
BlogPraise
:{
BlogPraise
:{
praiseList
:
'/api/blog/'
,
//博客点赞 +{blogId}/praises
praiseList
:
'/api/blog/'
,
//博客点赞 +{blogId}/praises
...
...
components/pc/nav/navCard.vue
View file @
1aaafe72
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
class=
"label-list"
class=
"label-list"
v-for=
"(item, key) in childList"
v-for=
"(item, key) in childList"
:key=
"`$
{item}${key}`"
:key=
"`$
{item}${key}`"
:to="{path: item.address, query: {
type: labelId, childId
: item.childId}}">
:to="{path: item.address, query: {
type
: item.childId}}">
{{
item
.
label
}}
{{
item
.
label
}}
</nuxt-link>
</nuxt-link>
</div>
</div>
...
@@ -113,7 +113,6 @@
...
@@ -113,7 +113,6 @@
.label-list-box{
.label-list-box{
box-sizing
:
border-box
;
box-sizing
:
border-box
;
width
:
308
*$
length
;
width
:
308
*$
length
;
height
:
122
*$
length
;
padding
:
21
*$
length
23
*$
length
16
*$
length
20
*$
length
;
padding
:
21
*$
length
23
*$
length
16
*$
length
20
*$
length
;
@extend
%flex-row-spb;
@extend
%flex-row-spb;
align-items
:
start
;
align-items
:
start
;
...
...
pages/blog/index.vue
View file @
1aaafe72
...
@@ -111,12 +111,31 @@ export default {
...
@@ -111,12 +111,31 @@ export default {
},
},
dataGetBlogCategory
(){
dataGetBlogCategory
(){
this
.
typeList
.
map
((
val
,
index
)
=>
{
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
,
})
})
this
.
list
.
push
({
label
:
val
.
category
,
address
:
'/blog'
,
type
:
val
.
categoryId
,
childList
})
}
else
{
this
.
list
.
push
({
this
.
list
.
push
({
label
:
val
.
category
,
label
:
val
.
category
,
address
:
'/blog'
,
address
:
'/blog'
,
type
:
val
.
categoryId
type
:
val
.
categoryId
})
})
}
})
})
},
},
...
...
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