Closed a21ns1g4ts closed 5 years ago
Can you give me your _nav.js
?
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',
},
],
},
],
},
],
}
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
Thank this solved my problem.
When the user click in page or reload the sidebar item cannot stayed expand After reload :