fix: show view icon in sidebar
This commit is contained in:
parent
838e2085cf
commit
115400a1ee
@ -115,7 +115,7 @@ import { viewsStore } from '@/stores/views'
|
|||||||
import { notificationsStore } from '@/stores/notifications'
|
import { notificationsStore } from '@/stores/notifications'
|
||||||
import { FeatherIcon } from 'frappe-ui'
|
import { FeatherIcon } from 'frappe-ui'
|
||||||
import { useStorage } from '@vueuse/core'
|
import { useStorage } from '@vueuse/core'
|
||||||
import { computed } from 'vue'
|
import { computed, h } from 'vue'
|
||||||
|
|
||||||
const { getPinnedViews, getPublicViews } = viewsStore()
|
const { getPinnedViews, getPublicViews } = viewsStore()
|
||||||
const { toggle: toggleNotificationPanel } = notificationsStore()
|
const { toggle: toggleNotificationPanel } = notificationsStore()
|
||||||
@ -196,7 +196,7 @@ function parseView(views) {
|
|||||||
return views.map((view) => {
|
return views.map((view) => {
|
||||||
return {
|
return {
|
||||||
label: view.label,
|
label: view.label,
|
||||||
icon: getIcon(view.route_name),
|
icon: getIcon(view.route_name, view.icon),
|
||||||
to: {
|
to: {
|
||||||
name: view.route_name,
|
name: view.route_name,
|
||||||
query: { view: view.name },
|
query: { view: view.name },
|
||||||
@ -205,7 +205,9 @@ function parseView(views) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function getIcon(routeName) {
|
function getIcon(routeName, icon) {
|
||||||
|
if (icon) return h('div', icon)
|
||||||
|
|
||||||
switch (routeName) {
|
switch (routeName) {
|
||||||
case 'Leads':
|
case 'Leads':
|
||||||
return LeadsIcon
|
return LeadsIcon
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user