我有下面的设置;主干路由不会在单击产品或销售链接时启动我是否必须从视图中显式调用导航?
<script type="text/javascript">
$(function () {
var Router = Backbone.Router.extend({
routes: {
"Products": "products",
"Sales": "sales"
},
products: function () {
console.log('products');
},
sales: function () {
console.log('sales');
}
});
new Router();
Backbone.history.start();
});
</script>
我在 aspx 页面中有 2 个产品链接
<div id= "Store">
<ul>
<li><a href="#Products">Products</a> </li>
<li><a href="#Sales"> Sales</a> </li>
</ul>
</div>