Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't active menu #178

Open
Jasonzhangjs opened this issue Jan 8, 2020 · 1 comment
Open

Can't active menu #178

Jasonzhangjs opened this issue Jan 8, 2020 · 1 comment

Comments

@Jasonzhangjs
Copy link

firstse

When the page reloads, the label(li class="active") has been cleared
th

@glavrjk
Copy link

glavrjk commented Feb 8, 2020

try to take a look your backend code i think you have a error or your have 2 or more li active declarations. I use the route page for taking the item correct. like this in Symfony 4

<li {{ (app.request.get('_route')[:10]=='dashboard_' ) ? 'class="active"' : '' }}>
          <a href="javascript:void(0);" class="menu-toggle">
              <i class="material-icons">dashboard</i>
              <span>Dashboards</span>
          </a>
          <ul class="ml-menu">
              <li {{ (app.request.get('_route')=='dashboard_sales' ) ? 'class="active"' : '' }}>
                  <a href="{{ path('dashboard_sales') }}">Ventas</a>
              </li>
              <li {{ (app.request.get('_route')=='dashboard_purchases' ) ? 'class="active"' : '' }}>
                  <a href="{{ path('dashboard_purchases') }}">Compras</a>
              </li> 
          </ul>
      </li>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants