数据切换不适用于我的Navbar组件

时间:2016-08-08 21:47:17

标签: twitter-bootstrap

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Demo</title>

    <!-- CSS -->
    <!-- load bootstrap and add some custom css -->
    <link rel="stylesheet" href="bootstrap.min.css">

    <!-- JS -->
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>

</head>

<body class="container">    
    <nav class="navbar navbar-default">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-target="#mainNavbar" data-toggle="collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>
            <div class="navbar-collapse collapse" id="mainNavbar">
                <ul class="nav navbar-nav">
                    <li class="active"><a href="#">Home</a></li>
                    <li><a href="#">Customer</a></li>
                    <li><a href="#">Products</a></li>
                    <li><a href="#">Coupons</a></li>
                    <li><a href="#">Delivery</a></li>
                    <li><a href="#">Orders</a></li>
                </ul>
                <form class="navbar-form navbar-right">
                    <button name="login" class="btn btn-primary">Login</button>
                </form>
            </div>
    </nav>
</body>
</html>

我只保留了一个Navbar组件。当谈到小屏幕我得到一个图标栏但是当我点击它时数据不会切换。我已经给出了数据目标,但它无法正常工作。有人可以帮助我。

0 个答案:

没有答案