{"action":"created","issue":{"url":"https://api.github.com/repos/airyland/vux/issues/471","repository_url":"https://api.github.com/repos/airyland/vux","labels_url":"https://api.github.com/repos/airyland/vux/issues/471/labels{/name}","comments_url":"https://api.github.com/repos/airyland/vux/issues/471/comments","events_url":"https://api.github.com/repos/airyland/vux/issues/471/events","html_url":"https://github.com/airyland/vux/issues/471","id":170130890,"number":471,"title":"popup-picker BUG","user":{"login":"outman2008","id":6269503,"avatar_url":"https://avatars.githubusercontent.com/u/6269503?v=3","gravatar_id":"","url":"https://api.github.com/users/outman2008","html_url":"https://github.com/outman2008","followers_url":"https://api.github.com/users/outman2008/followers","following_url":"https://api.github.com/users/outman2008/following{/other_user}","gists_url":"https://api.github.com/users/outman2008/gists{/gist_id}","starred_url":"https://api.github.com/users/outman2008/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/outman2008/subscriptions","organizations_url":"https://api.github.com/users/outman2008/orgs","repos_url":"https://api.github.com/users/outman2008/repos","events_url":"https://api.github.com/users/outman2008/events{/privacy}","received_events_url":"https://api.github.com/users/outman2008/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/airyland/vux/labels/component/popup-picker","name":"component/popup-picker","color":"0e8a16"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-08-09T10:16:03Z","updated_at":"2016-08-17T01:03:22Z","closed_at":null,"body":"### Version\r\n\r\nv0.1.2\r\n\bmac OS X 10.10.5\r\nGoogle Chrome 52.0.2743.116 (64-bit)\r\n\r\n### Your Codes \r\n\r\n <popup-picker title=\"选择班级\" :data=\"classList\" :columns=\"1\" :value.sync=\"selectClass\" show-name></popup-picker>\r\nexport default {\r\n   data() {\r\n       return {\r\n        classList: [],\r\n        selectClass: [],\r\n      }\r\n    },\r\n   created() {\r\n      this.classList = [{\r\n         name:\"2019届5班\",\r\n         \bvalue:\"1\"\r\n      },{\r\n         name:\"2019届4班\",\r\n         \bvalue:\"2\"\r\n      }]\r\n      this.selectClass=['2']\r\n    },\r\n}\r\n\r\n### Expected behavior and actual behavior.\r\n\r\n初始化时 popup-picker 没有数据,AJAX 请求回数据后绑定到 data 上\r\n界面能够显示,但是控制台报错:\r\nindex.vue?9278:65 Uncaught TypeError: Cannot read property 'value' of undefined\r\n跟踪代码发现:\r\nvux-master/src/components/picker/index.vue\r\n65行: _this.value.$set(i, data[i][0].value || data[i][0]) 报错\r\n\r\n### Steps to reproduce the problem\r\n\r\npicker/index.vue 源代码片段:\r\n\r\nrender (data, value) {\r\n      this.count = this.data.length\r\n      const _this = this\r\n      if (!data || !data.length) {\r\n        return\r\n      }\r\n      let count = this.data.length\r\n      // set first item as value\r\n      if (value.length < count) {\r\n        for (let i = 0; i < count; i++) {\r\n          _this.value.$set(i, data[i][0].value || data[i][0])\r\n        }\r\n      }\r\n\r\n估计是这个组件 render (data, value) 方法里面的变量data引用混乱的问题,\r\n局部变量定义了个 data 这个和全局变量 this.data 造成了混淆 \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/airyland/vux/issues/comments/240285328","html_url":"https://github.com/airyland/vux/issues/471#issuecomment-240285328","issue_url":"https://api.github.com/repos/airyland/vux/issues/471","id":240285328,"user":{"login":"yhZhouYh","id":13265388,"avatar_url":"https://avatars.githubusercontent.com/u/13265388?v=3","gravatar_id":"","url":"https://api.github.com/users/yhZhouYh","html_url":"https://github.com/yhZhouYh","followers_url":"https://api.github.com/users/yhZhouYh/followers","following_url":"https://api.github.com/users/yhZhouYh/following{/other_user}","gists_url":"https://api.github.com/users/yhZhouYh/gists{/gist_id}","starred_url":"https://api.github.com/users/yhZhouYh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yhZhouYh/subscriptions","organizations_url":"https://api.github.com/users/yhZhouYh/orgs","repos_url":"https://api.github.com/users/yhZhouYh/repos","events_url":"https://api.github.com/users/yhZhouYh/events{/privacy}","received_events_url":"https://api.github.com/users/yhZhouYh/received_events","type":"User","site_admin":false},"created_at":"2016-08-17T01:03:22Z","updated_at":"2016-08-17T01:03:22Z","body":"@outman2008 最后数据结构是怎么定义的 我这边 可以显示，但是貌似每次点完成后都显示第一个"}}
{"actor":{"display_login":"yhZhouYh"}}