mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-16 11:15:12 +00:00
add title "tags"
This commit is contained in:
@@ -83,10 +83,22 @@ class SideNav extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
component = (
|
||||||
|
<div>
|
||||||
|
<p>Tags</p>
|
||||||
|
{this.folderListComponent(data)}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return component
|
||||||
|
}
|
||||||
|
|
||||||
|
folderListComponent (data) {
|
||||||
let tagList = data.tagNoteMap.map((tag, key) => {
|
let tagList = data.tagNoteMap.map((tag, key) => {
|
||||||
return key
|
return key
|
||||||
})
|
})
|
||||||
component = (
|
return (
|
||||||
tagList.map(tag => {
|
tagList.map(tag => {
|
||||||
return (
|
return (
|
||||||
<TagListItem name={tag} handleClickTagButton={this.handleClickTagButton.bind(this)} />
|
<TagListItem name={tag} handleClickTagButton={this.handleClickTagButton.bind(this)} />
|
||||||
@@ -95,11 +107,7 @@ class SideNav extends React.Component {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return component
|
|
||||||
}
|
|
||||||
|
|
||||||
handleClickTagButton (e, name) {
|
handleClickTagButton (e, name) {
|
||||||
console.log(name)
|
|
||||||
let { router } = this.context
|
let { router } = this.context
|
||||||
router.push(`/tags/${name}`)
|
router.push(`/tags/${name}`)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user