npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-auto-track

v1.4.4

Published

auto tracking for vue

Downloads

21

Readme

环境依赖

uniapp vue2.0

部署步骤

  1. npm install vue-auto-track

  2. import track from 'vue-auto-track'(main.js)

  3. Vue.use(track, { env: 'xx', upload: Promise, size: xxx, constData: Object, pageConfig:Object })

目录结构描述

├├── index.js
└── untils
    ├── env.js
    ├── exposure.js      //监控组件或者页面元素曝光
    ├── get-upload.js    //收集+上传
    ├── global.js        //全局常量
    ├── lifecycle.js     //小程序生命周期
    ├── native.js        //基础数据采集
    ├── temp.js
    └── tools.js         //js方法库

options

| option | type | values | des
| ---------- | ------- | ------- | -----------------------------------------------
| env | String | require | 'wx' 或'h5'
| upload | Promise | require | 返回结果为 Promise 对象的请求方法
| size | Number | require | 触发上传数据大小
| constData | Object | custom | 每个埋点事件触发携带的基础常量如: ip,版本,平台等
| dyData | Object | custom | 每个埋点事件触发携带的动态变量: 各类唯一 id
| pageConfig | Object | custom | 页面配置项如: 曝光的节点元素

Vue.use(track, {
  env: "wx",
  upload: (data) => request("https://xxxxx.xxxxx.xxxxx/eReport", { data }),
  size: 10000,
  constData: {
    app_cd: "jixuan",
    platform: "wx_h5",
    client_version: "吉选平台V3.1.0",
  },
  pageConfig,
  dyData() {
    return {};
  },
  plugins: [
    (eventId, data) => uma.trackEvent(eventId), //eventId可以通过data加工
  ],
});

pageConfig

| option | type | values | des | | ----------- | ------ | ------- | -------------- | | selectorsPg | Array | require | 页面级元素曝光 | | selectorsCp | Array | require | 组件级元素曝光 | | name | String | require | 页面级元素曝光 | | route | String | require | 组件级元素曝光 |

export const homePage = {
  //监控曝光
  selectorsPg: [
    {
      selector: ".back-top",
      multipule: false,
    },
  ],
  selectorsCp: [
    {
      selector: ".goods__wrapper",
      multipule: false,
    },
  ],
  name: "首页",
  route: "pages/tabs/index/index",
};