{"action":"created","issue":{"url":"https://api.github.com/repos/alibaba/weex/issues/1630","repository_url":"https://api.github.com/repos/alibaba/weex","labels_url":"https://api.github.com/repos/alibaba/weex/issues/1630/labels{/name}","comments_url":"https://api.github.com/repos/alibaba/weex/issues/1630/comments","events_url":"https://api.github.com/repos/alibaba/weex/issues/1630/events","html_url":"https://github.com/alibaba/weex/issues/1630","id":188889410,"number":1630,"title":"list的bug","user":{"login":"zhangdefu3","id":20473759,"avatar_url":"https://avatars.githubusercontent.com/u/20473759?v=3","gravatar_id":"","url":"https://api.github.com/users/zhangdefu3","html_url":"https://github.com/zhangdefu3","followers_url":"https://api.github.com/users/zhangdefu3/followers","following_url":"https://api.github.com/users/zhangdefu3/following{/other_user}","gists_url":"https://api.github.com/users/zhangdefu3/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangdefu3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangdefu3/subscriptions","organizations_url":"https://api.github.com/users/zhangdefu3/orgs","repos_url":"https://api.github.com/users/zhangdefu3/repos","events_url":"https://api.github.com/users/zhangdefu3/events{/privacy}","received_events_url":"https://api.github.com/users/zhangdefu3/received_events","type":"User","site_admin":false},"labels":[{"id":339914711,"url":"https://api.github.com/repos/alibaba/weex/labels/question","name":"question","color":"cc317c","default":true},{"id":339914712,"url":"https://api.github.com/repos/alibaba/weex/labels/wontfix","name":"wontfix","color":"fef2c0","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-12T03:25:41Z","updated_at":"2016-11-15T11:02:17Z","closed_at":null,"body":"**bug: list的bug.** \r\n描述：我把list放在上面(flex:6)，把提示文本放在下面(flex:1)。页面刚加载时，onappear的cell数，比展示出来的多。\r\n\r\n源代码如下：\r\n\r\n><template>\r\n    <div style=\"flex:1;\">\r\n        <list class=\"main\">\r\n            <cell repeat=\"{{rows}}\" index=\"{{$index}}\" onappear=\"onappear\" ondisappear=\"ondisappear\">\r\n                <div class=\"cell-in\">\r\n                    <text class=\"cell-text\">row - {{id}}</text>\r\n                </div>\r\n            </cell>\r\n        </list>\r\n        <div class=\"footer\">\r\n            <text class=\"count\">{{minAppearId}} ---- {{maxAppearId}}</text>\r\n        </div>\r\n    </div>\r\n</template>\r\n\r\n><style>\r\n    .main{\r\n        flex:7;\r\n    }\r\n    .footer{\r\n        flex:1;\r\n        background-color: yellow;\r\n    }\r\n    .count{\r\n        font-size:24px;\r\n        margin:20px;\r\n        text-align: center;\r\n    }\r\n    .cell-in{\r\n        border-bottom-width:2px;\r\n        border-bottom-color: silver;\r\n    }\r\n    .cell-text{\r\n        font-size:40px;\r\n        padding:16px;\r\n    }\r\n</style>\r\n\r\n><script>\r\n    var debugMode = true;\r\n    module.exports = {\r\n        data:{\r\n            appearIds:[],\r\n            minAppearId:1,\r\n            maxAppearId:1,\r\n            rows:[\r\n                {id:1},\r\n                {id:2},\r\n                {id:3},\r\n                {id:4},\r\n                {id:5},\r\n                {id:6},\r\n                {id:7},\r\n                {id:8},\r\n                {id:9},\r\n                {id:10},\r\n                {id:11},\r\n                {id:12},\r\n                {id:13},\r\n                {id:14},\r\n                {id:15},\r\n                {id:16},\r\n                {id:17},\r\n                {id:18},\r\n                {id:19},\r\n                {id:20}\r\n            ]\r\n        },\r\n        computed:{\r\n\r\n        },\r\n        methods:{\r\n            refreshAppearData:function(){\r\n                this.appearIds.sort(function(a, b){\r\n                    return a - b;\r\n                });\r\n                this.minAppearId = this.appearIds[0];\r\n                this.maxAppearId = this.appearIds[this.appearIds.length - 1];\r\n            },\r\n            onappear:function(e){\r\n                var appearId = this.rows[e.target.attr.index].id;\r\n                if(debugMode){\r\n                    console.log(\"+++++++++++++项目：\" + appearId);\r\n                }\r\n                var index1 = this.appearIds.indexOf(appearId);\r\n                if(index1 < 0){\r\n                    this.appearIds.push(appearId);\r\n                    this.refreshAppearData();\r\n                }\r\n            },\r\n            ondisappear:function(e){\r\n                var disappearId = this.rows[e.target.attr.index].id;\r\n                if(debugMode){\r\n                    console.log(\"------------项目：\" + disappearId);\r\n                }\r\n                var index1 = this.appearIds.indexOf(disappearId);\r\n                if(index1 > -1){\r\n                    this.appearIds.splice(index1, 1);\r\n                    this.refreshAppearData();\r\n                }\r\n            }\r\n\r\n        },\r\n        created:function(){\r\n\r\n        }\r\n    }\r\n</script>\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/alibaba/weex/issues/comments/260612236","html_url":"https://github.com/alibaba/weex/issues/1630#issuecomment-260612236","issue_url":"https://api.github.com/repos/alibaba/weex/issues/1630","id":260612236,"user":{"login":"Hanks10100","id":8401776,"avatar_url":"https://avatars.githubusercontent.com/u/8401776?v=3","gravatar_id":"","url":"https://api.github.com/users/Hanks10100","html_url":"https://github.com/Hanks10100","followers_url":"https://api.github.com/users/Hanks10100/followers","following_url":"https://api.github.com/users/Hanks10100/following{/other_user}","gists_url":"https://api.github.com/users/Hanks10100/gists{/gist_id}","starred_url":"https://api.github.com/users/Hanks10100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hanks10100/subscriptions","organizations_url":"https://api.github.com/users/Hanks10100/orgs","repos_url":"https://api.github.com/users/Hanks10100/repos","events_url":"https://api.github.com/users/Hanks10100/events{/privacy}","received_events_url":"https://api.github.com/users/Hanks10100/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T11:02:17Z","updated_at":"2016-11-15T11:02:17Z","body":"@WangXiZhu 我测了是有的，帮你把代码补全：\r\n\r\n```html\r\n<template>\r\n  <div>\r\n    <div class=\"tabbar\"  onclick=\"switchPage($index)\" repeat=\"{{item in tabItems}}\">\r\n      <text>{{$index}}</text>\r\n    </div>\r\n  </div>\r\n</template>\r\n<script>\r\n  module.exports = {\r\n    data: {\r\n      tabItems: [{},{},{}]\r\n    },\r\n    methods: {\r\n      switchPage: function(index){     \r\n        console.info(index);\r\n      }\r\n    }\r\n  }\r\n</script>\r\n```"}}
{"actor":{"display_login":"Hanks10100"}}