如何在angular8中显示侧边栏,我已将侧边栏和导航栏放置在单独的组件中,侧边栏已隐藏,但我无法显示/切换侧边栏

时间:2019-09-26 11:08:09

标签: typescript angular8

我想显示/隐藏侧边栏,但是两者都在不同的组件中,我在其他组件中使用侧边栏和导航栏选择器来显示侧边栏和导航栏。

// navbar html

<nav class="navbar navbar-expand-lg ">
<div class="container-fluid">
    <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
        aria-controls="navigation-index" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-bar burger-lines"></span>
        <span class="navbar-toggler-bar burger-lines"></span>
        <span class="navbar-toggler-bar burger-lines"></span>
    </button>
    <div class="ml-auto">
        <a href="#" class="text-secondary">
            <button type="button" class="btn btn-primary">Logout</button>
        </a>
    </div>
</div>

//侧边栏html

<div class="sidebar">
<div class="logo">
    <a class="simple-text logo-normal">
        Sidebar
    </a>
</div>
<div class="sidebar-wrapper">
    <ul class="nav">
        <li class="nav-item " [routerLink]="['/dashboard']" routerLinkActive="active">
            <a class="nav-link">
                <p>Dashboard</p>
            </a>
        </li>
    </ul>
</div>

0 个答案:

没有答案