Socket
Socket
Sign inDemoInstall

vue-ba

Package Overview
Dependencies
33
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.5 to 1.2.6

2

package.json
{
"name": "vue-ba",
"version": "1.2.5",
"version": "1.2.6",
"description": "baidu analystics vue module",

@@ -5,0 +5,0 @@ "author": "minlingchao<mrminlingchao@gmail.com>",

@@ -86,2 +86,4 @@ # vue-ba

统计自定义事件使用 v-track-event.someEvent.custom
#### 用法

@@ -96,2 +98,4 @@

<input v-track-event.someEvent.custom="'category, action'"> // 统计someEvent事件,someEvent是自定义事件
<button v-track-event="'category, action, opt_label, opt_value'"><button> // 以字符串传递参数

@@ -98,0 +102,0 @@

import ba from '../index'
import { notChanged, isEmpty } from './utils'
export default function (el, binding) {
export default function (el, binding, vnode) {
if (notChanged(binding) || isEmpty(binding)) {

@@ -29,5 +29,11 @@ return

events.forEach((event) => {
el.addEventListener(event, () => ba.trackEvent(...args), false)
events.forEach((eventValue) => {
const customTag = 'custom'
let [event, custom] = eventValue.split(':')
if (custom === customTag) {
vnode.componentInstance.$on(event, () => ba.trackEvent(...args), false)
} else {
el.addEventListener(event, () => ba.trackEvent(...args), false)
}
})
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc