Skip to content

Commit

Permalink
Merge pull request #10 from l-hammer/uvpv_zap
Browse files Browse the repository at this point in the history
uvpv track called when path change
  • Loading branch information
LHammer authored Jul 30, 2019
2 parents c517cf3 + bb54898 commit 86b1efe
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/dist/js/app.c3e9c962.js → docs/dist/js/app.96608e54.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/dist/js/app.96608e54.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/dist/js/app.c3e9c962.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=dist/favicon.ico><link href=//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/nord.min.css rel=stylesheet><title>v-track</title><link href=dist/css/app.1efa72a7.css rel=preload as=style><link href=dist/css/chunk-vendors.bf068a49.css rel=preload as=style><link href=dist/js/app.c3e9c962.js rel=preload as=script><link href=dist/js/chunk-vendors.c94e27ba.js rel=preload as=script><link href=dist/css/chunk-vendors.bf068a49.css rel=stylesheet><link href=dist/css/app.1efa72a7.css rel=stylesheet></head><body><noscript><strong>We're sorry but v-track doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=dist/js/chunk-vendors.c94e27ba.js></script><script src=dist/js/app.c3e9c962.js></script></body></html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=dist/favicon.ico><link href=//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/nord.min.css rel=stylesheet><title>v-track</title><link href=dist/css/app.1efa72a7.css rel=preload as=style><link href=dist/css/chunk-vendors.bf068a49.css rel=preload as=style><link href=dist/js/app.96608e54.js rel=preload as=script><link href=dist/js/chunk-vendors.c94e27ba.js rel=preload as=script><link href=dist/css/chunk-vendors.bf068a49.css rel=stylesheet><link href=dist/css/app.1efa72a7.css rel=stylesheet></head><body><noscript><strong>We're sorry but v-track doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=dist/js/chunk-vendors.c94e27ba.js></script><script src=dist/js/app.96608e54.js></script></body></html>
5 changes: 2 additions & 3 deletions docs/tracks/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: 宋慧武
* @Date: 2019-04-14 16:44:42
* @Last Modified by: 宋慧武
* @Last Modified time: 2019-04-16 11:28:36
* @Last Modified time: 2019-07-30 20:17:13
*/
import { Notification, Message } from "element-ui";
import { format } from "../utils/date";
Expand Down Expand Up @@ -32,7 +32,6 @@ export default function trackAction(evt, addtional = {}) {
dangerouslyUseHTMLString: true,
message: createFragment(data),
customClass: "notification__large",
position: evt === "1" || evt === "2" ? "top-left" : "top-right",
offset: evt === "2" ? 198 : 0
position: evt === "1" || evt === "2" ? "top-left" : "top-right"
});
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "v-track",
"version": "0.8.1",
"version": "0.8.2",
"description": "一个基于Vue指令的埋点插件",
"author": "LHammer <[email protected]>",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: 宋慧武
* @Date: 2019-03-06 17:49:29
* @Last Modified by: 宋慧武
* @Last Modified time: 2019-07-26 11:28:45
* @Last Modified time: 2019-07-30 20:15:53
*/
import * as hooks from "./hooks";

Expand Down Expand Up @@ -59,10 +59,10 @@ export default class VTrack {
// 统计UV、PV
beforeRouteEnter(to, _, next) {
// 防止有些情况该守卫执行多次导致重复埋点的问题
if (to.name === self.curPage) {
if (to.fullPath === self.curPage) {
next();
} else {
self.curPage = to.name;
self.curPage = to.fullPath;
next(vm => {
trackEnable.UVPV && trackEvents.UVPV(vm);
});
Expand Down

0 comments on commit 86b1efe

Please sign in to comment.