Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@sensorskit/vue-input-binding
Advanced tools
用神策追踪输入框的聚焦失焦事件
事件 属性 InputFocus InputLabel? InputBlur InputLabel?, StayTime, StayMSTime
yarn add @sensorskit/vue-input-binding
在 Vue.js 项目的入口处引入:
import VueInputBinding from '@sensorskit/vue-input-binding'
Vue.use(VueInputBinding)
// 如果需要自定义选项
Vue.use(VueInputBinding, {
sa: window.sa // 神策 JS SDK 暴露的全局变量
})
在需要自动触发聚焦失焦事件的地方引入自定义指令:
<!-- 此时会自动触发神策的聚焦失焦事件,并带上必要属性,需要在引入时配置 sa 全局变量 -->
<input type="text" data-label="手机号" v-sa-track>
如果在元素上设置了 data-label
属性,触发神策事件时会自动带上 InputLabel 属性。
如果需要自行处理聚焦失焦逻辑:
<input type="text" v-on-focus="onFocus" v-on-blur="onBlur">
此时,数据框聚焦时会触发 onFocus 方法,失焦时会触发 onBlur 方法,onBlur 会接收一个参数:
export default {
...
methods: {
onFocus() {
sa.track('InputFocus', { ...your custom properties })
},
// onBlur 接收一个 Object 参数,里面包含距离上次聚焦的停留时间:StayTime, StayMSTime
onBlur({ StayTime, StayMSTime }) {
sa.track('InputBlur', {
...your custom properties,
StayMSTime, // 毫秒
StayTime // 秒
})
}
}
}
FAQs
vue custom directive for focus and blur binding
The npm package @sensorskit/vue-input-binding receives a total of 2 weekly downloads. As such, @sensorskit/vue-input-binding popularity was classified as not popular.
We found that @sensorskit/vue-input-binding demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.