Add draft count to nav panel
This commit is contained in:
parent
1bffcc5fe7
commit
71f16ec39c
|
@ -82,7 +82,8 @@ export const ROOT_ITEMS = {
|
||||||
drafts: {
|
drafts: {
|
||||||
route: 'drafts',
|
route: 'drafts',
|
||||||
icon: 'file-pen',
|
icon: 'file-pen',
|
||||||
label: 'nav.drafts'
|
label: 'nav.drafts',
|
||||||
|
badgeGetter: 'draftCount'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,9 @@ export const getters = {
|
||||||
},
|
},
|
||||||
draftsArray (state) {
|
draftsArray (state) {
|
||||||
return Object.values(state.drafts)
|
return Object.values(state.drafts)
|
||||||
|
},
|
||||||
|
draftCount (state) {
|
||||||
|
return Object.values(state.drafts).length
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue