{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs/vue/issues/3309","repository_url":"https://api.github.com/repos/vuejs/vue","labels_url":"https://api.github.com/repos/vuejs/vue/issues/3309/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/vue/issues/3309/comments","events_url":"https://api.github.com/repos/vuejs/vue/issues/3309/events","html_url":"https://github.com/vuejs/vue/issues/3309","id":167002375,"number":3309,"title":"Vue 2 directive deprecated acceptStatement ","user":{"login":"TOP-Chao","id":3605154,"avatar_url":"https://avatars.githubusercontent.com/u/3605154?v=3","gravatar_id":"","url":"https://api.github.com/users/TOP-Chao","html_url":"https://github.com/TOP-Chao","followers_url":"https://api.github.com/users/TOP-Chao/followers","following_url":"https://api.github.com/users/TOP-Chao/following{/other_user}","gists_url":"https://api.github.com/users/TOP-Chao/gists{/gist_id}","starred_url":"https://api.github.com/users/TOP-Chao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TOP-Chao/subscriptions","organizations_url":"https://api.github.com/users/TOP-Chao/orgs","repos_url":"https://api.github.com/users/TOP-Chao/repos","events_url":"https://api.github.com/users/TOP-Chao/events{/privacy}","received_events_url":"https://api.github.com/users/TOP-Chao/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-22T09:09:02Z","updated_at":"2016-07-22T15:03:01Z","closed_at":"2016-07-22T15:03:01Z","body":"How do I deal with inline statements !\r\n```html\r\n<div id=\"app\">\r\n    {{show}}\r\n    <button v-tap=\"show = true\">show</button>\r\n    {{show}}\r\n    <button v-tap=\"hide()\">hide</button>\r\n    {{show}}\r\n</div>\r\n```\r\n```javascript\r\nVue.directive('tap', {\r\n    bind: function (el, binding) {\r\n    }\r\n});\r\nvar vm = new Vue({\r\n    el: '#app',\r\n    data: {\r\n        show: false\r\n    },\r\n    methods: {\r\n        hide: function () {\r\n            this.$data.show = false;\r\n        }\r\n    }\r\n});\r\n```\r\noutput html \r\n```html\r\nfalse\r\n<button>show</button>\r\ntrue\r\n<button>hide</button>\r\nfalse\r\n```\r\nwhy should we abolish it? that is now how to achieve it?\r\n"},"comment":{"url":"https://api.github.com/repos/vuejs/vue/issues/comments/234568326","html_url":"https://github.com/vuejs/vue/issues/3309#issuecomment-234568326","issue_url":"https://api.github.com/repos/vuejs/vue/issues/3309","id":234568326,"user":{"login":"yyx990803","id":499550,"avatar_url":"https://avatars.githubusercontent.com/u/499550?v=3","gravatar_id":"","url":"https://api.github.com/users/yyx990803","html_url":"https://github.com/yyx990803","followers_url":"https://api.github.com/users/yyx990803/followers","following_url":"https://api.github.com/users/yyx990803/following{/other_user}","gists_url":"https://api.github.com/users/yyx990803/gists{/gist_id}","starred_url":"https://api.github.com/users/yyx990803/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yyx990803/subscriptions","organizations_url":"https://api.github.com/users/yyx990803/orgs","repos_url":"https://api.github.com/users/yyx990803/repos","events_url":"https://api.github.com/users/yyx990803/events{/privacy}","received_events_url":"https://api.github.com/users/yyx990803/received_events","type":"User","site_admin":false},"created_at":"2016-07-22T15:03:01Z","updated_at":"2016-07-22T15:03:01Z","body":"It's no longer recommended to create custom directives that behaves like `v-on`. Instead, you can dispatch native DOM events in your directive, and then use `v-on` to listen to them:\r\n\r\n``` js\r\nVue.directive('tappable', {\r\n    bind: function (el) {\r\n      // when a tap happens\r\n      var e = document.createEvent('HTMLEvents')\r\n      e.initEvent('tap', true, true)\r\n      el.dispatchEvent(e)\r\n    }\r\n});\r\n```\r\n\r\nIn template:\r\n\r\n``` html\r\n<button v-tappable @tap=\"hide()\">\r\n```"}}
{"actor":{"display_login":"yyx990803"}}