{"action":"created","issue":{"url":"https://api.github.com/repos/weexteam/article/issues/15","repository_url":"https://api.github.com/repos/weexteam/article","labels_url":"https://api.github.com/repos/weexteam/article/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/weexteam/article/issues/15/comments","events_url":"https://api.github.com/repos/weexteam/article/issues/15/events","html_url":"https://github.com/weexteam/article/issues/15","id":160609549,"number":15,"title":"事件 - (Events)","user":{"login":"Tancy","id":184419,"avatar_url":"https://avatars.githubusercontent.com/u/184419?v=3","gravatar_id":"","url":"https://api.github.com/users/Tancy","html_url":"https://github.com/Tancy","followers_url":"https://api.github.com/users/Tancy/followers","following_url":"https://api.github.com/users/Tancy/following{/other_user}","gists_url":"https://api.github.com/users/Tancy/gists{/gist_id}","starred_url":"https://api.github.com/users/Tancy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tancy/subscriptions","organizations_url":"https://api.github.com/users/Tancy/orgs","repos_url":"https://api.github.com/users/Tancy/repos","events_url":"https://api.github.com/users/Tancy/events{/privacy}","received_events_url":"https://api.github.com/users/Tancy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-06-16T08:51:32Z","updated_at":"2016-12-06T06:31:41Z","closed_at":null,"body":"weex 允许对`<template>` 中的元素绑定事件处理器。属性名称是以`on...`为前缀加事件类型 和处理函数名。例如：`onclick=\"handler\"`\n\n``` html\n<template>\n  <image onclick=\"handler\" ...></image>\n</template>\n\n<script>\n  module.exports = {\n    methods: {\n      handler: function (e) {\n        // TODO\n      }\n    }\n  }\n</script>\n```\n\n当用户点击图片时， `<script>` 中定义的handler 函数将被执行。\n## 添加参数\n\n除了使用方法名外，你也可以自定义入参。\ne.g.\n\n``` html\n<template>\n  <image onclick=\"handler('arg1', $event)\" ...></image>\n</template>\n\n<script>\n  module.exports = {\n    methods: {\n      handler: function (arg1, e) {\n        // TODO\n      }\n    }\n  }\n</script>\n```\n## 事件对象\n\n当一个事件函数被调用，它会收到的第一个参数就是事件对象。每个事件对象包含一下属性。\n- `type`: 事件名称, 如: `click`\n- `target`: 目标元素 \n- `timestamp`: 事件触发的时间戳\n\n接下来，请看 [ 显示逻辑控制器](./display-logic.md).\n"},"comment":{"url":"https://api.github.com/repos/weexteam/article/issues/comments/265072238","html_url":"https://github.com/weexteam/article/issues/15#issuecomment-265072238","issue_url":"https://api.github.com/repos/weexteam/article/issues/15","id":265072238,"user":{"login":"RrtoyewxXu","id":17476635,"avatar_url":"https://avatars.githubusercontent.com/u/17476635?v=3","gravatar_id":"","url":"https://api.github.com/users/RrtoyewxXu","html_url":"https://github.com/RrtoyewxXu","followers_url":"https://api.github.com/users/RrtoyewxXu/followers","following_url":"https://api.github.com/users/RrtoyewxXu/following{/other_user}","gists_url":"https://api.github.com/users/RrtoyewxXu/gists{/gist_id}","starred_url":"https://api.github.com/users/RrtoyewxXu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RrtoyewxXu/subscriptions","organizations_url":"https://api.github.com/users/RrtoyewxXu/orgs","repos_url":"https://api.github.com/users/RrtoyewxXu/repos","events_url":"https://api.github.com/users/RrtoyewxXu/events{/privacy}","received_events_url":"https://api.github.com/users/RrtoyewxXu/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T06:31:41Z","updated_at":"2016-12-06T06:31:41Z","body":"@zghkevin \r\n可以啊，"}}
{"actor":{"display_login":"RrtoyewxXu"}}