Sidebar item child not expand after reload page
Closed this issue · 4 comments
a21ns1g4ts commented
adenvt commented
Can you give me your _nav.js?
a21ns1g4ts commented
Can you give me your
_nav.js?
export default {
items: [
{
name : 'Painel',
url : '/painel',
icon : 'icon-speedometer',
badge: {
variant: 'primary',
text : 'administração',
},
},
{
title : true,
name : 'Módulos',
class : '',
wrapper: {
element : '',
attributes: {},
},
},
{
name : 'Contribuinte',
url : '/painel/contribuinte',
icon : 'icon-people',
children: [
{
name: 'Criar',
url : '/painel/contribuinte/criar',
icon: 'icon-user-follow',
},
{
name: 'Listar',
url : '/painel/contribuinte/listar',
icon: 'icon-list',
},
],
},
{
name : 'Configurações',
url : '/painel/configuracoes/index',
icon : 'icon-wrench',
children: [
{
name: 'Listar',
url : '/painel/configuracoes/index',
icon: 'icon-grid',
},
{
name : 'Orgao',
url : '/painel/configuracoes/orgao/index',
icon : 'fa fa-bullseye',
children: [
{
name: 'Criar',
url : '/painel/configuracoes/orgao/criar',
icon: 'icon-plus',
},
{
name: 'Listar',
url : '/painel/configuracoes/orgao/listar',
icon: 'icon-list',
},
],
},
{
name : 'Convênio',
url : '/painel/configuracoes/convenio/listar',
icon : 'icon-wrench',
children: [
{
name: 'Criar',
url : '/painel/configuracoes/convenio/criar',
icon: 'icon-plus',
},
{
name: 'Listar',
url : '/painel/configuracoes/convenio/listar',
icon: 'icon-list',
},
],
},
],
},
],
}adenvt commented
Sidebar Dropdown expand automatically using router-link active state when component created.
At Configurações, url is /painel/configuracoes/index, when you visited /painel/configuracoes/convenio/criar, router-link not detected it as active because /painel/configuracoes/convenio/criar not contains /painel/configuracoes/index.
Solution, change /painel/configuracoes/index to /painel/configuracoes. and add redirect /painel/configuracoes to /painel/configuracoes/index in router/index.js
a21ns1g4ts commented
Thank this solved my problem.

