{"action":"created","issue":{"url":"https://api.github.com/repos/weui/weui/issues/563","repository_url":"https://api.github.com/repos/weui/weui","labels_url":"https://api.github.com/repos/weui/weui/issues/563/labels{/name}","comments_url":"https://api.github.com/repos/weui/weui/issues/563/comments","events_url":"https://api.github.com/repos/weui/weui/issues/563/events","html_url":"https://github.com/weui/weui/issues/563","id":196097516,"number":563,"title":"window.pageManager.go存在bug，拿官方提供的Demo做在线演示","user":{"login":"aiyuchen","id":578141,"avatar_url":"https://avatars.githubusercontent.com/u/578141?v=3","gravatar_id":"","url":"https://api.github.com/users/aiyuchen","html_url":"https://github.com/aiyuchen","followers_url":"https://api.github.com/users/aiyuchen/followers","following_url":"https://api.github.com/users/aiyuchen/following{/other_user}","gists_url":"https://api.github.com/users/aiyuchen/gists{/gist_id}","starred_url":"https://api.github.com/users/aiyuchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aiyuchen/subscriptions","organizations_url":"https://api.github.com/users/aiyuchen/orgs","repos_url":"https://api.github.com/users/aiyuchen/repos","events_url":"https://api.github.com/users/aiyuchen/events{/privacy}","received_events_url":"https://api.github.com/users/aiyuchen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-16T16:25:20Z","updated_at":"2016-12-17T15:54:57Z","closed_at":null,"body":"chrome打开https://weui.io      ，启动调试工具按照移动端的方式查看\r\n找到\r\n```\r\n<script type=\"text/html\" id=\"tpl_list\">\r\n```\r\n将\r\n```\r\n<h1 class=\"page__title\">List</h1>\r\n// 修改HTML为\r\n<h1 class=\"page__title\"><a href=\"javascript:window.pageManager.go('home');\" class=\"\">List</a></h1>\r\n```\r\n\r\n找到\r\n```\r\n<script type=\"text/html\" id=\"tpl_input\">\r\n```\r\n将\r\n```\r\n<h1 class=\"page__title\">Input</h1>\r\n// 修改HTML为\r\n<h1 class=\"page__title\"><a href=\"javascript:window.pageManager.go('list');\" class=\"\">Input</a></h1>\r\n```\r\n\r\n问题：\r\nOK，现在可以在【首页】、【列表】页面、【表单】页面，来回点击切换，点击次数不用超过3次，你会发现，页面乱了，本该进入首页的，进入列表页了，或者是本该进入列表页的，进入首页了。。。。。\r\n\r\n我是没搞明白这是什么问题，求助有谁懂，怎么解决"},"comment":{"url":"https://api.github.com/repos/weui/weui/issues/comments/267770025","html_url":"https://github.com/weui/weui/issues/563#issuecomment-267770025","issue_url":"https://api.github.com/repos/weui/weui/issues/563","id":267770025,"user":{"login":"aiyuchen","id":578141,"avatar_url":"https://avatars.githubusercontent.com/u/578141?v=3","gravatar_id":"","url":"https://api.github.com/users/aiyuchen","html_url":"https://github.com/aiyuchen","followers_url":"https://api.github.com/users/aiyuchen/followers","following_url":"https://api.github.com/users/aiyuchen/following{/other_user}","gists_url":"https://api.github.com/users/aiyuchen/gists{/gist_id}","starred_url":"https://api.github.com/users/aiyuchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aiyuchen/subscriptions","organizations_url":"https://api.github.com/users/aiyuchen/orgs","repos_url":"https://api.github.com/users/aiyuchen/repos","events_url":"https://api.github.com/users/aiyuchen/events{/privacy}","received_events_url":"https://api.github.com/users/aiyuchen/received_events","type":"User","site_admin":false},"created_at":"2016-12-17T15:54:57Z","updated_at":"2016-12-17T15:54:57Z","body":"重新优化了一下，应该这样比较合理。如果找到了之前的页面，而这个页面并非当前页面下一层，就一层一层的删除\r\n```\r\nif (!found) {\r\n    // 这里保持和官方写的代码不变，增加一个ELSE\r\n} else {\r\n                for(var i = this._pageStack.length - 1; i > 0; --i) {\r\n                    if (!this._pageStack[i]) {\r\n                        continue;\r\n                    }\r\n\r\n                    this._pageIndex--;\r\n                    if (this._pageStack[i].config.url == url) {\r\n                        break;\r\n                    }\r\n\r\n                    this._pageStack[i].dom.remove();\r\n                    this._pageStack.splice(i, 1);\r\n                }\r\n}\r\n```"}}
{"actor":{"display_login":"aiyuchen"}}