1、使用ng-route: app.js中的写法: 需要导入angular-route.js: html中的写法: 2、使用ui-router: 需要导入angular-ui-router.js(需要下载):