{"action":"created","comment":{"url":"https://api.github.com/repos/ecomfe/san-website/pulls/comments/134423501","pull_request_review_id":57710903,"id":134423501,"diff_hunk":"@@ -12,7 +12,7 @@ categories:\n #### 路由配置\n 使用 san-router 和 San 构建单页应用的系统主要基于路由和组件。路由处理放在浏览器端来直接响应浏览器地址的变换，分发到对应的路由。在路由发生变化时，通过加载相应的组件，替换需要改变的部分，来向用户呈现对应的界面。所以路由配置是比较关键的一步。\n \n-单页应用系统中应该创建一个入口js文件(如 main.js),在其中可以配置相关路由,attach一个根组件,并将路由的target设置为根组件中的标签:\n+单页应用系统中应该创建一个入口 js 文件(如 main.js ),在其中可以配置相关路由, attach 一个根组件,并将路由的 target 设置为根组件中的标签:\n ","path":"source/_posts/practice/san-router-spa.md","position":null,"original_position":6,"commit_id":"c5d52990334139439b5c7d5eb0c85df5c3f489e0","original_commit_id":"403fc4ed4192957a236d335a9fb4f4c1134d43ff","user":{"login":"sw811","id":8544819,"avatar_url":"https://avatars3.githubusercontent.com/u/8544819?v=4","gravatar_id":"","url":"https://api.github.com/users/sw811","html_url":"https://github.com/sw811","followers_url":"https://api.github.com/users/sw811/followers","following_url":"https://api.github.com/users/sw811/following{/other_user}","gists_url":"https://api.github.com/users/sw811/gists{/gist_id}","starred_url":"https://api.github.com/users/sw811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sw811/subscriptions","organizations_url":"https://api.github.com/users/sw811/orgs","repos_url":"https://api.github.com/users/sw811/repos","events_url":"https://api.github.com/users/sw811/events{/privacy}","received_events_url":"https://api.github.com/users/sw811/received_events","type":"User","site_admin":false},"body":"对于路由的配置文件，router.start()建议不要在这里做了吧，还有router.listen如果较复杂的情况下建议也抽出去，这里只做路由的配置规则使用","created_at":"2017-08-22T09:04:53Z","updated_at":"2017-08-22T09:04:58Z","html_url":"https://github.com/ecomfe/san-website/pull/21#discussion_r134423501","pull_request_url":"https://api.github.com/repos/ecomfe/san-website/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/ecomfe/san-website/pulls/comments/134423501"},"html":{"href":"https://github.com/ecomfe/san-website/pull/21#discussion_r134423501"},"pull_request":{"href":"https://api.github.com/repos/ecomfe/san-website/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/ecomfe/san-website/pulls/21","id":136456776,"html_url":"https://github.com/ecomfe/san-website/pull/21","diff_url":"https://github.com/ecomfe/san-website/pull/21.diff","patch_url":"https://github.com/ecomfe/san-website/pull/21.patch","issue_url":"https://api.github.com/repos/ecomfe/san-website/issues/21","number":21,"state":"open","locked":false,"title":"fix(doc): 如何使用san-router构建一个单页应用的后台系统","user":{"login":"sqliang","id":6252409,"avatar_url":"https://avatars1.githubusercontent.com/u/6252409?v=4","gravatar_id":"","url":"https://api.github.com/users/sqliang","html_url":"https://github.com/sqliang","followers_url":"https://api.github.com/users/sqliang/followers","following_url":"https://api.github.com/users/sqliang/following{/other_user}","gists_url":"https://api.github.com/users/sqliang/gists{/gist_id}","starred_url":"https://api.github.com/users/sqliang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqliang/subscriptions","organizations_url":"https://api.github.com/users/sqliang/orgs","repos_url":"https://api.github.com/users/sqliang/repos","events_url":"https://api.github.com/users/sqliang/events{/privacy}","received_events_url":"https://api.github.com/users/sqliang/received_events","type":"User","site_admin":false},"body":"san教程路由管理增加如何使用san-router建立一个单页应用的后台系统\r\n![san_router_spa_web](https://user-images.githubusercontent.com/6252409/29552686-f13cea22-874a-11e7-9b0d-2429e166920a.png)\r\n\r\n","created_at":"2017-08-18T11:19:18Z","updated_at":"2017-08-22T09:04:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c2140c91f6ce870a664793950611cf5d707e2b8","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ecomfe/san-website/pulls/21/commits","review_comments_url":"https://api.github.com/repos/ecomfe/san-website/pulls/21/comments","review_comment_url":"https://api.github.com/repos/ecomfe/san-website/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ecomfe/san-website/issues/21/comments","statuses_url":"https://api.github.com/repos/ecomfe/san-website/statuses/c5d52990334139439b5c7d5eb0c85df5c3f489e0","head":{"label":"sqliang:master","ref":"master","sha":"c5d52990334139439b5c7d5eb0c85df5c3f489e0","user":{"login":"sqliang","id":6252409,"avatar_url":"https://avatars1.githubusercontent.com/u/6252409?v=4","gravatar_id":"","url":"https://api.github.com/users/sqliang","html_url":"https://github.com/sqliang","followers_url":"https://api.github.com/users/sqliang/followers","following_url":"https://api.github.com/users/sqliang/following{/other_user}","gists_url":"https://api.github.com/users/sqliang/gists{/gist_id}","starred_url":"https://api.github.com/users/sqliang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqliang/subscriptions","organizations_url":"https://api.github.com/users/sqliang/orgs","repos_url":"https://api.github.com/users/sqliang/repos","events_url":"https://api.github.com/users/sqliang/events{/privacy}","received_events_url":"https://api.github.com/users/sqliang/received_events","type":"User","site_admin":false},"repo":{"id":99561312,"name":"san-website","full_name":"sqliang/san-website","owner":{"login":"sqliang","id":6252409,"avatar_url":"https://avatars1.githubusercontent.com/u/6252409?v=4","gravatar_id":"","url":"https://api.github.com/users/sqliang","html_url":"https://github.com/sqliang","followers_url":"https://api.github.com/users/sqliang/followers","following_url":"https://api.github.com/users/sqliang/following{/other_user}","gists_url":"https://api.github.com/users/sqliang/gists{/gist_id}","starred_url":"https://api.github.com/users/sqliang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqliang/subscriptions","organizations_url":"https://api.github.com/users/sqliang/orgs","repos_url":"https://api.github.com/users/sqliang/repos","events_url":"https://api.github.com/users/sqliang/events{/privacy}","received_events_url":"https://api.github.com/users/sqliang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sqliang/san-website","description":null,"fork":true,"url":"https://api.github.com/repos/sqliang/san-website","forks_url":"https://api.github.com/repos/sqliang/san-website/forks","keys_url":"https://api.github.com/repos/sqliang/san-website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sqliang/san-website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sqliang/san-website/teams","hooks_url":"https://api.github.com/repos/sqliang/san-website/hooks","issue_events_url":"https://api.github.com/repos/sqliang/san-website/issues/events{/number}","events_url":"https://api.github.com/repos/sqliang/san-website/events","assignees_url":"https://api.github.com/repos/sqliang/san-website/assignees{/user}","branches_url":"https://api.github.com/repos/sqliang/san-website/branches{/branch}","tags_url":"https://api.github.com/repos/sqliang/san-website/tags","blobs_url":"https://api.github.com/repos/sqliang/san-website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sqliang/san-website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sqliang/san-website/git/refs{/sha}","trees_url":"https://api.github.com/repos/sqliang/san-website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sqliang/san-website/statuses/{sha}","languages_url":"https://api.github.com/repos/sqliang/san-website/languages","stargazers_url":"https://api.github.com/repos/sqliang/san-website/stargazers","contributors_url":"https://api.github.com/repos/sqliang/san-website/contributors","subscribers_url":"https://api.github.com/repos/sqliang/san-website/subscribers","subscription_url":"https://api.github.com/repos/sqliang/san-website/subscription","commits_url":"https://api.github.com/repos/sqliang/san-website/commits{/sha}","git_commits_url":"https://api.github.com/repos/sqliang/san-website/git/commits{/sha}","comments_url":"https://api.github.com/repos/sqliang/san-website/comments{/number}","issue_comment_url":"https://api.github.com/repos/sqliang/san-website/issues/comments{/number}","contents_url":"https://api.github.com/repos/sqliang/san-website/contents/{+path}","compare_url":"https://api.github.com/repos/sqliang/san-website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sqliang/san-website/merges","archive_url":"https://api.github.com/repos/sqliang/san-website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sqliang/san-website/downloads","issues_url":"https://api.github.com/repos/sqliang/san-website/issues{/number}","pulls_url":"https://api.github.com/repos/sqliang/san-website/pulls{/number}","milestones_url":"https://api.github.com/repos/sqliang/san-website/milestones{/number}","notifications_url":"https://api.github.com/repos/sqliang/san-website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sqliang/san-website/labels{/name}","releases_url":"https://api.github.com/repos/sqliang/san-website/releases{/id}","deployments_url":"https://api.github.com/repos/sqliang/san-website/deployments","created_at":"2017-08-07T09:32:29Z","updated_at":"2017-08-07T09:32:30Z","pushed_at":"2017-08-22T06:48:41Z","git_url":"git://github.com/sqliang/san-website.git","ssh_url":"git@github.com:sqliang/san-website.git","clone_url":"https://github.com/sqliang/san-website.git","svn_url":"https://github.com/sqliang/san-website","homepage":null,"size":1018,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ecomfe:master","ref":"master","sha":"070176fb235b1f14a5296071b656185930d790b7","user":{"login":"ecomfe","id":2268460,"avatar_url":"https://avatars2.githubusercontent.com/u/2268460?v=4","gravatar_id":"","url":"https://api.github.com/users/ecomfe","html_url":"https://github.com/ecomfe","followers_url":"https://api.github.com/users/ecomfe/followers","following_url":"https://api.github.com/users/ecomfe/following{/other_user}","gists_url":"https://api.github.com/users/ecomfe/gists{/gist_id}","starred_url":"https://api.github.com/users/ecomfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecomfe/subscriptions","organizations_url":"https://api.github.com/users/ecomfe/orgs","repos_url":"https://api.github.com/users/ecomfe/repos","events_url":"https://api.github.com/users/ecomfe/events{/privacy}","received_events_url":"https://api.github.com/users/ecomfe/received_events","type":"Organization","site_admin":false},"repo":{"id":68011965,"name":"san-website","full_name":"ecomfe/san-website","owner":{"login":"ecomfe","id":2268460,"avatar_url":"https://avatars2.githubusercontent.com/u/2268460?v=4","gravatar_id":"","url":"https://api.github.com/users/ecomfe","html_url":"https://github.com/ecomfe","followers_url":"https://api.github.com/users/ecomfe/followers","following_url":"https://api.github.com/users/ecomfe/following{/other_user}","gists_url":"https://api.github.com/users/ecomfe/gists{/gist_id}","starred_url":"https://api.github.com/users/ecomfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecomfe/subscriptions","organizations_url":"https://api.github.com/users/ecomfe/orgs","repos_url":"https://api.github.com/users/ecomfe/repos","events_url":"https://api.github.com/users/ecomfe/events{/privacy}","received_events_url":"https://api.github.com/users/ecomfe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ecomfe/san-website","description":null,"fork":false,"url":"https://api.github.com/repos/ecomfe/san-website","forks_url":"https://api.github.com/repos/ecomfe/san-website/forks","keys_url":"https://api.github.com/repos/ecomfe/san-website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ecomfe/san-website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ecomfe/san-website/teams","hooks_url":"https://api.github.com/repos/ecomfe/san-website/hooks","issue_events_url":"https://api.github.com/repos/ecomfe/san-website/issues/events{/number}","events_url":"https://api.github.com/repos/ecomfe/san-website/events","assignees_url":"https://api.github.com/repos/ecomfe/san-website/assignees{/user}","branches_url":"https://api.github.com/repos/ecomfe/san-website/branches{/branch}","tags_url":"https://api.github.com/repos/ecomfe/san-website/tags","blobs_url":"https://api.github.com/repos/ecomfe/san-website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ecomfe/san-website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ecomfe/san-website/git/refs{/sha}","trees_url":"https://api.github.com/repos/ecomfe/san-website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ecomfe/san-website/statuses/{sha}","languages_url":"https://api.github.com/repos/ecomfe/san-website/languages","stargazers_url":"https://api.github.com/repos/ecomfe/san-website/stargazers","contributors_url":"https://api.github.com/repos/ecomfe/san-website/contributors","subscribers_url":"https://api.github.com/repos/ecomfe/san-website/subscribers","subscription_url":"https://api.github.com/repos/ecomfe/san-website/subscription","commits_url":"https://api.github.com/repos/ecomfe/san-website/commits{/sha}","git_commits_url":"https://api.github.com/repos/ecomfe/san-website/git/commits{/sha}","comments_url":"https://api.github.com/repos/ecomfe/san-website/comments{/number}","issue_comment_url":"https://api.github.com/repos/ecomfe/san-website/issues/comments{/number}","contents_url":"https://api.github.com/repos/ecomfe/san-website/contents/{+path}","compare_url":"https://api.github.com/repos/ecomfe/san-website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ecomfe/san-website/merges","archive_url":"https://api.github.com/repos/ecomfe/san-website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ecomfe/san-website/downloads","issues_url":"https://api.github.com/repos/ecomfe/san-website/issues{/number}","pulls_url":"https://api.github.com/repos/ecomfe/san-website/pulls{/number}","milestones_url":"https://api.github.com/repos/ecomfe/san-website/milestones{/number}","notifications_url":"https://api.github.com/repos/ecomfe/san-website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ecomfe/san-website/labels{/name}","releases_url":"https://api.github.com/repos/ecomfe/san-website/releases{/id}","deployments_url":"https://api.github.com/repos/ecomfe/san-website/deployments","created_at":"2016-09-12T13:36:52Z","updated_at":"2017-08-07T12:13:13Z","pushed_at":"2017-08-22T06:48:42Z","git_url":"git://github.com/ecomfe/san-website.git","ssh_url":"git@github.com:ecomfe/san-website.git","clone_url":"https://github.com/ecomfe/san-website.git","svn_url":"https://github.com/ecomfe/san-website","homepage":null,"size":860,"stargazers_count":2,"watchers_count":2,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":3,"forks":12,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ecomfe/san-website/pulls/21"},"html":{"href":"https://github.com/ecomfe/san-website/pull/21"},"issue":{"href":"https://api.github.com/repos/ecomfe/san-website/issues/21"},"comments":{"href":"https://api.github.com/repos/ecomfe/san-website/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/ecomfe/san-website/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/ecomfe/san-website/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ecomfe/san-website/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/ecomfe/san-website/statuses/c5d52990334139439b5c7d5eb0c85df5c3f489e0"}}}}
{"actor":{"display_login":"sw811"}}