{"action":"opened","issue":{"url":"https://api.github.com/repos/Narutocc/Vue/issues/50","repository_url":"https://api.github.com/repos/Narutocc/Vue","labels_url":"https://api.github.com/repos/Narutocc/Vue/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/Narutocc/Vue/issues/50/comments","events_url":"https://api.github.com/repos/Narutocc/Vue/issues/50/events","html_url":"https://github.com/Narutocc/Vue/issues/50","id":370514172,"node_id":"MDU6SXNzdWUzNzA1MTQxNzI=","number":50,"title":"vue-ba","user":{"login":"Narutocc","id":23731437,"node_id":"MDQ6VXNlcjIzNzMxNDM3","avatar_url":"https://avatars1.githubusercontent.com/u/23731437?v=4","gravatar_id":"","url":"https://api.github.com/users/Narutocc","html_url":"https://github.com/Narutocc","followers_url":"https://api.github.com/users/Narutocc/followers","following_url":"https://api.github.com/users/Narutocc/following{/other_user}","gists_url":"https://api.github.com/users/Narutocc/gists{/gist_id}","starred_url":"https://api.github.com/users/Narutocc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Narutocc/subscriptions","organizations_url":"https://api.github.com/users/Narutocc/orgs","repos_url":"https://api.github.com/users/Narutocc/repos","events_url":"https://api.github.com/users/Narutocc/events{/privacy}","received_events_url":"https://api.github.com/users/Narutocc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-16T09:14:48Z","updated_at":"2018-10-16T09:14:48Z","closed_at":null,"author_association":"OWNER","body":"### vue-ba 是vuejs百度统计埋点插件\r\n**下载：npm install vue-ba --save-dev**\r\n\r\n**加载：import ba from 'vue-ba'**\r\n\r\n**使用：Vue.use(ba, options)**\r\n\r\n```\r\n// options设置\r\n{\r\n  siteId: 绑定要接受API请求的统计代码\r\n  debug: false 调试模式下将在控制台中输出调用window._hmt时传递的参数\r\n  src: 指定统计脚本标签的src属性\r\n}\r\n```\r\n### ba API\r\n```\r\nthis.$ba.trackEvent(category, action, opt_label, opt_value)\r\n```\r\n- category：表示事件发生在谁身上\r\n- action：表示访客跟元素交互的行为动作\r\n- opt_label：用于更详细的描述事件\r\n- opt_value：用于填写打分型事件的分值\r\n### ba 指令\r\nvue-ba提供track-event,track-pageview两个指令，开发者可以直接在html模板中使用来统计网站数据\r\n其中一种写法，以对象字面量传递参数，如下：\r\n```\r\n<button v-track-event=\"{category:'event', action:'click',opt_label: `测试测试`}\"></button>\r\n```\r\n**有三种不同的写法**\r\n```\r\nv-track-event=\"{category:'event', action:'click',opt_label: `测试测试`}\"\r\n\r\n@click=\"$ba.trackEvent('click', '按钮点击', `测试测试`)\"\r\n\r\nthis.$ba.trackEvent('click', '按钮点击', `测试测试`)\r\n```"}}
{"actor":{"display_login":"Narutocc"}}