假设我有 index.html :
<div ui-view="viewA">
// content
</div>
是否可以将内容放入 div 中作为我的默认路由?因此,无需包含或其他任何内容,只需将一些标记直接放在该 div 中即可。
最佳答案
这是可能的,而且真的很容易。所以,让我们把它放在 index.html 中
<div ui-view="">
this is the content of ui-view,
which serves as a template for a default state
</div>
这可能是默认状态,否则
$urlRouterProvider.otherwise('/default');
// States
$stateProvider
.state('default', {
url: "/default",
})
查一下here
关于javascript - div 中的 UI-Router 默认 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37648492/