我正在尝试在网站上显示侧边栏菜单。但是,它没有出现。
应用代码:
appModule.config([
'$stateProvider', '$urlRouterProvider',
function ($stateProvider, $urlRouterProvider) {
// Default route (overrided below if user has permission)
$urlRouterProvider.otherwise("/home");
$stateProvider.state('home', {
url: '/home',
templateUrl: '~/App/common/views/home/index.cshtml',
menu: 'Home'
});}
html和js代码:
<script type="text/javascript" src="~/custom/js/jquery.mmenu.min.all.js"></script>
@* Below JS is for slide out menu *@
<script type="text/javascript">
$(document).ready(function () {
$("#menu").mmenu({
"slidingSubmenus": false,
"offCanvas": {
"zposition": "front",
"pageSelector": "#page"
}
});
});
</script>
<a href="#menu" class="navbar-brand">
<button class="navbar-toggle" type="button">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</a>
<nav id="menu">
<ul>
<li><a href="/application#/home">test</a></li>
</ul>
</nav>
这是我得到的网站:
答案 0 :(得分:0)
对不起菜单代码并且没有在布局页面中显示。当我搬家时,它突然开始起作用了。