{"action":"opened","issue":{"url":"https://api.github.com/repos/tianlman/vue_demo/issues/8","repository_url":"https://api.github.com/repos/tianlman/vue_demo","labels_url":"https://api.github.com/repos/tianlman/vue_demo/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/tianlman/vue_demo/issues/8/comments","events_url":"https://api.github.com/repos/tianlman/vue_demo/issues/8/events","html_url":"https://github.com/tianlman/vue_demo/issues/8","id":255460508,"number":8,"title":"vue 父组件传递数据给子组建","user":{"login":"tianlman","id":23731577,"avatar_url":"https://avatars3.githubusercontent.com/u/23731577?v=4","gravatar_id":"","url":"https://api.github.com/users/tianlman","html_url":"https://github.com/tianlman","followers_url":"https://api.github.com/users/tianlman/followers","following_url":"https://api.github.com/users/tianlman/following{/other_user}","gists_url":"https://api.github.com/users/tianlman/gists{/gist_id}","starred_url":"https://api.github.com/users/tianlman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tianlman/subscriptions","organizations_url":"https://api.github.com/users/tianlman/orgs","repos_url":"https://api.github.com/users/tianlman/repos","events_url":"https://api.github.com/users/tianlman/events{/privacy}","received_events_url":"https://api.github.com/users/tianlman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-06T02:18:35Z","updated_at":"2017-09-06T02:18:35Z","closed_at":null,"author_association":"OWNER","body":"父组件结构\r\n```\r\n<template>\r\n    <div>\r\n        <v-girl-group \r\n            :girls=\"aGirls\"></v-girl-group>\r\n    </div>\r\n</template>\r\n<script>\r\nimport vGirlGroup from './GirlGroup'\r\nexport default {\r\n    name: 'girl',\r\n    components: {\r\n        vGirlGroup\r\n    },\r\n    data () {\r\n        return {\r\n            aGirls:[{\r\n                name:'小丽',\r\n                age:22\r\n            },{\r\n                name:'小美',\r\n                age:21\r\n            },{\r\n                name:'小荷',\r\n                age:24\r\n            }]\r\n        }\r\n    }\r\n}\r\n</script>\r\n```\r\n\r\n子组件结构\r\n```\r\n<template>\r\n    <div>\r\n       <ul>\r\n           <li v-for=\"(value, index) in girls\">{{ index }} - {{ value.name }} - {{ value.age }}</li>\r\n       </ul>\r\n    </div>\r\n</template>\r\n<script>\r\nexport default {\r\n    name: 'girl-group',\r\n    props: {\r\n        girls: {\r\n            type: Array,\r\n            required: true\r\n        }\r\n    }\r\n}\r\n</script>\r\n```\r\n注意点：\r\nprops中的数据是来自在父组件中绑定在子组件上的值 另外:使用IDE、编辑器开发时，可能会提示成prop\r\ngirls中对数据做了一些校验\r\n\r\n"}}
{"actor":{"display_login":"tianlman"}}