cbvirtua 1.0.122 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -5
- package/valid.txt +468 -0
- package/vue3-hash-calendar-main.zip +0 -0
- package/1.zip +0 -0
- package/7.zip +0 -0
- package/888.zip +0 -0
- package/Checkbox Checked-1.png +0 -0
- package/_/345/217/267 (1).svg" +0 -1
- package/_/345/217/267.svg +0 -1
- package/a.png +0 -0
- package/babel-plugin-async-lock-master.zip +0 -0
- package/build-own-react-main.zip +0 -0
- package/check_box.svg +0 -1
- package/check_box_outline_blank.svg +0 -1
- package/checkbox_unchecked.svg +0 -1
- package/floating-vue-main.zip +0 -0
- package/font_2009600_gpzp7pxtnw.zip +0 -0
- package/font_2553510_ciljc7axaw7.woff +0 -0
- package/font_2553510_ciljc7axaw7.woff2 +0 -0
- package/leetcode-javascript-master.zip +0 -0
- package/loginDemo-master.zip +0 -0
- package/mi.txt +0 -374
- package/mitt-main.zip +0 -0
- package/mp-weixin-back-main.zip +0 -0
- package/pdfsss.txt +0 -900
- package/sms-check-code-master.zip +0 -0
- package/sss.txt +0 -2
- package/study-summarize-master.zip +0 -0
- package/tool.txt +0 -19
- package/v-dropdown-menu-master.zip +0 -0
- package/v-track-master/v-track-master/.browserslistrc +0 -3
- package/v-track-master/v-track-master/.eslintignore +0 -3
- package/v-track-master/v-track-master/.eslintrc.js +0 -15
- package/v-track-master/v-track-master/.gitattributes +0 -1
- package/v-track-master/v-track-master/.github/FUNDING.yml +0 -12
- package/v-track-master/v-track-master/.github/workflows/node.js.yml +0 -29
- package/v-track-master/v-track-master/.travis.yml +0 -22
- package/v-track-master/v-track-master/.yarnrc +0 -1
- package/v-track-master/v-track-master/LICENSE +0 -21
- package/v-track-master/v-track-master/README.md +0 -131
- package/v-track-master/v-track-master/babel.config.js +0 -25
- package/v-track-master/v-track-master/build/rollup.config.base.js +0 -14
- package/v-track-master/v-track-master/build/rollup.config.browser.js +0 -21
- package/v-track-master/v-track-master/build/rollup.config.es.js +0 -11
- package/v-track-master/v-track-master/docs/.babelrc +0 -5
- package/v-track-master/v-track-master/docs/App.vue +0 -61
- package/v-track-master/v-track-master/docs/assets/app.scss +0 -197
- package/v-track-master/v-track-master/docs/assets/index.scss +0 -10
- package/v-track-master/v-track-master/docs/assets/mixins.scss +0 -64
- package/v-track-master/v-track-master/docs/assets/normalize.scss +0 -349
- package/v-track-master/v-track-master/docs/components/button.vue +0 -15
- package/v-track-master/v-track-master/docs/components/code-snippet.vue +0 -72
- package/v-track-master/v-track-master/docs/dist/css/app.2e14d2d6.css +0 -4
- package/v-track-master/v-track-master/docs/dist/css/chunk-vendors.c687a9b2.css +0 -1
- package/v-track-master/v-track-master/docs/dist/favicon.ico +0 -0
- package/v-track-master/v-track-master/docs/dist/fonts/element-icons.535877f5.woff +0 -0
- package/v-track-master/v-track-master/docs/dist/fonts/element-icons.732389de.ttf +0 -0
- package/v-track-master/v-track-master/docs/dist/js/app.efe84ade.js +0 -2
- package/v-track-master/v-track-master/docs/dist/js/app.efe84ade.js.map +0 -1
- package/v-track-master/v-track-master/docs/dist/js/chunk-vendors.c94e27ba.js +0 -13
- package/v-track-master/v-track-master/docs/dist/js/chunk-vendors.c94e27ba.js.map +0 -1
- package/v-track-master/v-track-master/docs/index.html +0 -1
- package/v-track-master/v-track-master/docs/main.js +0 -78
- package/v-track-master/v-track-master/docs/pages/block-show.vue +0 -177
- package/v-track-master/v-track-master/docs/pages/custom-events.vue +0 -291
- package/v-track-master/v-track-master/docs/pages/home.vue +0 -269
- package/v-track-master/v-track-master/docs/pages/started.vue +0 -151
- package/v-track-master/v-track-master/docs/pages/track-view.vue +0 -234
- package/v-track-master/v-track-master/docs/tracks/action.js +0 -37
- package/v-track-master/v-track-master/docs/tracks/events.js +0 -140
- package/v-track-master/v-track-master/docs/tracks/index.js +0 -13
- package/v-track-master/v-track-master/docs/utils/date.js +0 -219
- package/v-track-master/v-track-master/docs/utils/dom.js +0 -26
- package/v-track-master/v-track-master/jest.config.js +0 -18
- package/v-track-master/v-track-master/package.json +0 -67
- package/v-track-master/v-track-master/postcss.config.js +0 -5
- package/v-track-master/v-track-master/public/favicon.ico +0 -0
- package/v-track-master/v-track-master/public/index.html +0 -18
- package/v-track-master/v-track-master/src/hooks/index.js +0 -217
- package/v-track-master/v-track-master/src/index.js +0 -79
- package/v-track-master/v-track-master/src/utils/debug.js +0 -13
- package/v-track-master/v-track-master/src/utils/dom.js +0 -73
- package/v-track-master/v-track-master/src/utils/helper.js +0 -122
- package/v-track-master/v-track-master/src/utils/vis-monitor.js +0 -183
- package/v-track-master/v-track-master/tests/helper.js +0 -37
- package/v-track-master/v-track-master/tests/unit/.eslintrc.js +0 -5
- package/v-track-master/v-track-master/tests/unit/track-click-async.spec.js +0 -52
- package/v-track-master/v-track-master/tests/unit/track-click-delay.spec.js +0 -46
- package/v-track-master/v-track-master/tests/unit/track-click-native.spec.js +0 -84
- package/v-track-master/v-track-master/tests/unit/track-click-param.spec.js +0 -55
- package/v-track-master/v-track-master/tests/unit/track-click.spec.js +0 -47
- package/v-track-master/v-track-master/tests/unit/track-custom-event-async.spec.js +0 -61
- package/v-track-master/v-track-master/tests/unit/track-custom-event-delay.spec.js +0 -59
- package/v-track-master/v-track-master/tests/unit/track-custom-event-param.spec.js +0 -68
- package/v-track-master/v-track-master/tests/unit/track-custom-event.spec.js +0 -55
- package/v-track-master/v-track-master/tests/unit/track-show-custom-scroll-once.spec.js +0 -62
- package/v-track-master/v-track-master/tests/unit/track-show-custom-scroll.spec.js +0 -62
- package/v-track-master/v-track-master/tests/unit/track-show-once.spec.js +0 -55
- package/v-track-master/v-track-master/tests/unit/track-show-param.spec.js +0 -51
- package/v-track-master/v-track-master/tests/unit/track-show.spec.js +0 -55
- package/v-track-master/v-track-master/tests/unit/track-view-vif.spec.js +0 -54
- package/v-track-master/v-track-master/tests/unit/track-view-watch-delay.spec.js +0 -63
- package/v-track-master/v-track-master/tests/unit/track-view-watch.spec.js +0 -61
- package/v-track-master/v-track-master/tests/unit/track-view.spec.js +0 -32
- package/v-track-master/v-track-master/vue.config.js +0 -45
- package/v-track-master/v-track-master/yarn.lock +0 -10186
- package/v-track-master.zip +0 -0
- package/vant-weapp-dev.zip +0 -0
- package/vue-autosize-input-master.zip +0 -0
- package/vue-awesome-dropdown-master.zip +0 -0
- package/vue-codemod-main.zip +0 -0
- package/vue-collapsed-main.zip +0 -0
- package/vue-input-code-master.zip +0 -0
- package/vue-jscodeshift-adapter-master.zip +0 -0
- package/vue-verify-master.zip +0 -0
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/.hbuilderx/launch.json +0 -11
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/App.vue +0 -17
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/README.md +0 -13
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/code.js +0 -408
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/css/icon.css +0 -342
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/css/style.scss +0 -119
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/search/index.vue +0 -66
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/tree.vue +0 -70
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/main.js +0 -11
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/manifest.json +0 -78
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages/chooseUser/chooseUser.vue +0 -69
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages/chooseUser/data.js +0 -96
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages/index/index.vue +0 -122
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages.json +0 -25
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/changelog.md +0 -80
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/en.json +0 -7
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/index.js +0 -8
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json +0 -7
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json +0 -7
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/keypress.js +0 -45
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/popup.js +0 -26
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/uni-popup.uvue +0 -90
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/uni-popup.vue +0 -496
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js +0 -45
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue +0 -313
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue +0 -143
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue +0 -187
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/package.json +0 -87
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/readme.md +0 -17
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/changelog.md +0 -8
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/index.scss +0 -1
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/package.json +0 -82
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/readme.md +0 -4
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/index.scss +0 -7
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_border.scss +0 -3
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_color.scss +0 -66
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_radius.scss +0 -55
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_space.scss +0 -56
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_styles.scss +0 -167
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_text.scss +0 -24
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_variables.scss +0 -146
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/tools/functions.scss +0 -19
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/theme.scss +0 -31
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/variables.scss +0 -62
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/changelog.md +0 -22
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/components/uni-transition/createAnimation.js +0 -131
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/components/uni-transition/uni-transition.vue +0 -286
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/package.json +0 -84
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/readme.md +0 -11
- package//346/224/266/347/274/251/344/270/212/347/256/255/345/244/264 (1).svg" +0 -1
- package//346/224/266/347/274/251/344/270/212/347/256/255/345/244/264.svg +0 -1
- package//346/224/266/347/274/251/344/270/213/347/256/255/345/244/264.svg +0 -1
- package//346/224/266/347/274/251/347/256/255/345/244/264.svg +0 -1
- package//346/226/260/345/273/272 /346/226/207/346/234/254/346/226/207/346/241/243 (2).txt" +0 -90
- package//346/226/260/345/273/272 /346/226/207/346/234/254/346/226/207/346/241/243 (3).txt" +0 -142
- package//346/226/260/345/273/272 /346/226/207/346/234/254/346/226/207/346/241/243 (3).zip +0 -0
- package//346/226/260/345/273/272 /346/226/207/346/234/254/346/226/207/346/241/243.txt" +0 -59
- package//351/227/256/345/217/267.svg +0 -1
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 宋慧武
|
|
3
|
-
* @Date: 2019-04-14 17:10:31
|
|
4
|
-
* @Last Modified by: 宋慧武
|
|
5
|
-
* @Last Modified time: 2020-06-05 20:42:48
|
|
6
|
-
*/
|
|
7
|
-
import trackAction from "./action";
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
/**
|
|
11
|
-
* @name UVPV 固定名称不支持修改
|
|
12
|
-
* @desc UV、PV埋点
|
|
13
|
-
* @param {Object} context 当前上下文
|
|
14
|
-
*/
|
|
15
|
-
UVPV() {
|
|
16
|
-
trackAction("1");
|
|
17
|
-
},
|
|
18
|
-
/**
|
|
19
|
-
* @name TONP 固定名称不支持修改
|
|
20
|
-
* @desc 页面停留时间埋点(Time on Page)
|
|
21
|
-
* @param {Object} context 当前上下文
|
|
22
|
-
* @param {Timestamp} et 进入页面时间
|
|
23
|
-
* @param {Timestamp} dt 离开页面时间
|
|
24
|
-
*/
|
|
25
|
-
TONP(_, { et, dt }) {
|
|
26
|
-
trackAction("2", {
|
|
27
|
-
stt: `${(dt - et) / 1e3}s`
|
|
28
|
-
});
|
|
29
|
-
},
|
|
30
|
-
/**
|
|
31
|
-
* @desc 测试埋点
|
|
32
|
-
*/
|
|
33
|
-
18015({ $route: { name } }) {
|
|
34
|
-
trackAction("18015", {
|
|
35
|
-
source_page: name // 页面来源
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
/**
|
|
39
|
-
* @param {Object} context 当前上下文
|
|
40
|
-
* @param {Object} item 事件参数
|
|
41
|
-
* @param {Object} event 事件对象
|
|
42
|
-
*/
|
|
43
|
-
18016(
|
|
44
|
-
{
|
|
45
|
-
$route: { name }
|
|
46
|
-
},
|
|
47
|
-
{ id },
|
|
48
|
-
{ target }
|
|
49
|
-
) {
|
|
50
|
-
trackAction("18016", {
|
|
51
|
-
id,
|
|
52
|
-
source_page: name,
|
|
53
|
-
target
|
|
54
|
-
});
|
|
55
|
-
},
|
|
56
|
-
18017({ index, $route: { name } }) {
|
|
57
|
-
trackAction("18017", {
|
|
58
|
-
source_page: name,
|
|
59
|
-
index
|
|
60
|
-
});
|
|
61
|
-
},
|
|
62
|
-
18018({ rest, $route: { name } }) {
|
|
63
|
-
trackAction("18018", {
|
|
64
|
-
source_page: name,
|
|
65
|
-
rest
|
|
66
|
-
});
|
|
67
|
-
},
|
|
68
|
-
18019(
|
|
69
|
-
{
|
|
70
|
-
$route: { name }
|
|
71
|
-
},
|
|
72
|
-
{ id },
|
|
73
|
-
{ target }
|
|
74
|
-
) {
|
|
75
|
-
trackAction("18019", {
|
|
76
|
-
id,
|
|
77
|
-
source_page: name,
|
|
78
|
-
target
|
|
79
|
-
});
|
|
80
|
-
},
|
|
81
|
-
18020({ activeName, $route: { name } }) {
|
|
82
|
-
trackAction("18020", {
|
|
83
|
-
source_page: name,
|
|
84
|
-
active_name: activeName
|
|
85
|
-
});
|
|
86
|
-
},
|
|
87
|
-
18021({ rest, $route: { name } }) {
|
|
88
|
-
trackAction("18021", {
|
|
89
|
-
source_page: name,
|
|
90
|
-
rest
|
|
91
|
-
});
|
|
92
|
-
},
|
|
93
|
-
18022({ $route: { name } }) {
|
|
94
|
-
trackAction("18022", {
|
|
95
|
-
source_page: name,
|
|
96
|
-
description: "这是一个页面初始化埋点"
|
|
97
|
-
});
|
|
98
|
-
},
|
|
99
|
-
18023({ $route: { name } }) {
|
|
100
|
-
trackAction("18023", {
|
|
101
|
-
source_page: name
|
|
102
|
-
});
|
|
103
|
-
},
|
|
104
|
-
18025({ rest1, $route: { name } }) {
|
|
105
|
-
trackAction("18025", {
|
|
106
|
-
source_page: name,
|
|
107
|
-
rest: rest1
|
|
108
|
-
});
|
|
109
|
-
},
|
|
110
|
-
18026({ rest2, $route: { name } }) {
|
|
111
|
-
trackAction("18026", {
|
|
112
|
-
source_page: name,
|
|
113
|
-
rest: rest2
|
|
114
|
-
});
|
|
115
|
-
},
|
|
116
|
-
18027({ $route: { name } }) {
|
|
117
|
-
trackAction("18027", {
|
|
118
|
-
source_page: name,
|
|
119
|
-
description: "我想被曝光无数次"
|
|
120
|
-
});
|
|
121
|
-
},
|
|
122
|
-
18028({ $route: { name } }) {
|
|
123
|
-
trackAction("18028", {
|
|
124
|
-
source_page: name,
|
|
125
|
-
description: "我只想被曝光一次"
|
|
126
|
-
});
|
|
127
|
-
},
|
|
128
|
-
18029({ $route: { name } }) {
|
|
129
|
-
trackAction("18029", {
|
|
130
|
-
source_page: name,
|
|
131
|
-
description: "我也想被曝光无数次"
|
|
132
|
-
});
|
|
133
|
-
},
|
|
134
|
-
18030({ $route: { name } }) {
|
|
135
|
-
trackAction("18030", {
|
|
136
|
-
source_page: name,
|
|
137
|
-
description: "我也想被曝光无数次"
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 宋慧武
|
|
3
|
-
* @Date: 2019-04-14 17:01:49
|
|
4
|
-
* @Last Modified by: 宋慧武
|
|
5
|
-
* @Last Modified time: 2019-04-14 17:12:29
|
|
6
|
-
*/
|
|
7
|
-
import trackEvents from "./events";
|
|
8
|
-
|
|
9
|
-
export { default as trackAction } from "./action";
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
...trackEvents
|
|
13
|
-
};
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author LHammer
|
|
3
|
-
* @desc date parse or format date
|
|
4
|
-
* @see https://github.com/l-hammer/YDTemplate/blob/master/src/utils/es6/date.js
|
|
5
|
-
*/
|
|
6
|
-
const twoDigits = /\d\d?/;
|
|
7
|
-
const fourDigits = /\d{4}/;
|
|
8
|
-
const token = /d{1,2}|M{1,2}|yy(?:yy)?|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
|
|
9
|
-
const masks = {
|
|
10
|
-
default: "yyyy-MM-dd HH:mm:ss",
|
|
11
|
-
date: "yyyy-MM-dd",
|
|
12
|
-
datetime: "yyyy-MM-dd HH:mm:ss",
|
|
13
|
-
time: "HH:mm:ss",
|
|
14
|
-
year: "yyyy",
|
|
15
|
-
enDate: "M/d/yy",
|
|
16
|
-
cnDate: "yyyy 年 MM 月 dd 日"
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const pad = (val, len) => {
|
|
20
|
-
val = String(val);
|
|
21
|
-
len = len || 2;
|
|
22
|
-
while (val.length < len) {
|
|
23
|
-
val = `0${val}`;
|
|
24
|
-
}
|
|
25
|
-
return val;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const formatFlags = {
|
|
29
|
-
yyyy(dateObj) {
|
|
30
|
-
return pad(dateObj.getFullYear(), 4);
|
|
31
|
-
},
|
|
32
|
-
yy(dateObj) {
|
|
33
|
-
return String(dateObj.getFullYear()).substr(2);
|
|
34
|
-
},
|
|
35
|
-
M(dateObj) {
|
|
36
|
-
return dateObj.getMonth() + 1;
|
|
37
|
-
},
|
|
38
|
-
MM(dateObj) {
|
|
39
|
-
return pad(dateObj.getMonth() + 1);
|
|
40
|
-
},
|
|
41
|
-
d(dateObj) {
|
|
42
|
-
return dateObj.getDate();
|
|
43
|
-
},
|
|
44
|
-
dd(dateObj) {
|
|
45
|
-
return pad(dateObj.getDate());
|
|
46
|
-
},
|
|
47
|
-
h(dateObj) {
|
|
48
|
-
return dateObj.getHours() % 12 || 12;
|
|
49
|
-
},
|
|
50
|
-
hh(dateObj) {
|
|
51
|
-
return pad(dateObj.getHours() % 12 || 12);
|
|
52
|
-
},
|
|
53
|
-
H(dateObj) {
|
|
54
|
-
return dateObj.getHours();
|
|
55
|
-
},
|
|
56
|
-
HH(dateObj) {
|
|
57
|
-
return pad(dateObj.getHours());
|
|
58
|
-
},
|
|
59
|
-
m(dateObj) {
|
|
60
|
-
return dateObj.getMinutes();
|
|
61
|
-
},
|
|
62
|
-
mm(dateObj) {
|
|
63
|
-
return pad(dateObj.getMinutes());
|
|
64
|
-
},
|
|
65
|
-
s(dateObj) {
|
|
66
|
-
return dateObj.getSeconds();
|
|
67
|
-
},
|
|
68
|
-
ss(dateObj) {
|
|
69
|
-
return pad(dateObj.getSeconds());
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Format a date
|
|
75
|
-
* @method format
|
|
76
|
-
* @param {Date|number} dateObj new Date(2018, 2, 9)
|
|
77
|
-
* @param {String} mask Format of the date e.g. 'yyyy-MM-dd HH:mm:ss' or 'cnDate'
|
|
78
|
-
*/
|
|
79
|
-
export const format = (dateObj, mask) => {
|
|
80
|
-
if (typeof dateObj === "number") {
|
|
81
|
-
dateObj = new Date(dateObj);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
Object.prototype.toString.call(dateObj) !== "[object Date]" ||
|
|
86
|
-
isNaN(dateObj.getTime())
|
|
87
|
-
) {
|
|
88
|
-
throw new Error("Invalid Date in date.format");
|
|
89
|
-
}
|
|
90
|
-
mask = masks[mask] || mask || masks.default;
|
|
91
|
-
|
|
92
|
-
// return 不可省略
|
|
93
|
-
mask = mask.replace(token, $0 => {
|
|
94
|
-
return $0 in formatFlags
|
|
95
|
-
? formatFlags[$0](dateObj)
|
|
96
|
-
: $0.slice(1, $0.length - 1);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
return mask;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const parseFlags = {
|
|
103
|
-
yyyy: [
|
|
104
|
-
fourDigits,
|
|
105
|
-
(d, v) => {
|
|
106
|
-
d.year = v;
|
|
107
|
-
}
|
|
108
|
-
],
|
|
109
|
-
yy: [
|
|
110
|
-
twoDigits,
|
|
111
|
-
(d, v) => {
|
|
112
|
-
const da = new Date();
|
|
113
|
-
const cent = +`${da.getFullYear()}`.substr(0, 2);
|
|
114
|
-
d.year = `${v > 68 ? cent - 1 : cent}${v}`;
|
|
115
|
-
}
|
|
116
|
-
],
|
|
117
|
-
M: [
|
|
118
|
-
twoDigits,
|
|
119
|
-
(d, v) => {
|
|
120
|
-
d.month = v - 1;
|
|
121
|
-
}
|
|
122
|
-
],
|
|
123
|
-
d: [
|
|
124
|
-
twoDigits,
|
|
125
|
-
(d, v) => {
|
|
126
|
-
d.day = v;
|
|
127
|
-
}
|
|
128
|
-
],
|
|
129
|
-
h: [
|
|
130
|
-
twoDigits,
|
|
131
|
-
(d, v) => {
|
|
132
|
-
d.hour = v;
|
|
133
|
-
}
|
|
134
|
-
],
|
|
135
|
-
m: [
|
|
136
|
-
twoDigits,
|
|
137
|
-
(d, v) => {
|
|
138
|
-
d.minute = v;
|
|
139
|
-
}
|
|
140
|
-
],
|
|
141
|
-
s: [
|
|
142
|
-
twoDigits,
|
|
143
|
-
(d, v) => {
|
|
144
|
-
d.second = v;
|
|
145
|
-
}
|
|
146
|
-
]
|
|
147
|
-
};
|
|
148
|
-
parseFlags.MM = parseFlags.M;
|
|
149
|
-
parseFlags.dd = parseFlags.d;
|
|
150
|
-
parseFlags.hh = parseFlags.h;
|
|
151
|
-
parseFlags.H = parseFlags.h;
|
|
152
|
-
parseFlags.HH = parseFlags.h;
|
|
153
|
-
parseFlags.mm = parseFlags.m;
|
|
154
|
-
parseFlags.ss = parseFlags.s;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Format a date
|
|
158
|
-
* @method parse
|
|
159
|
-
* @param {String} dateStr Date String e.g. '2018-02-09 09:29:29' or '2018 年 02 月 09 日'
|
|
160
|
-
* @param {String} mask Parse of the format date e.g. 'yyyy-MM-dd HH:mm:ss' or 'cnDate'
|
|
161
|
-
* @param {Date}
|
|
162
|
-
*/
|
|
163
|
-
export const parse = (dateStr, mask) => {
|
|
164
|
-
let isVaild = true;
|
|
165
|
-
const dateInfo = {};
|
|
166
|
-
const today = new Date();
|
|
167
|
-
|
|
168
|
-
if (typeof dateStr !== "string") {
|
|
169
|
-
throw new Error("Invalid format in fecha.parse");
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
mask = masks[mask] || mask || masks.default;
|
|
173
|
-
/**
|
|
174
|
-
* @function replace @see https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/replace;
|
|
175
|
-
* @param {String} $0 匹配的子串
|
|
176
|
-
*/
|
|
177
|
-
mask.replace(token, function($0) {
|
|
178
|
-
if (parseFlags[$0]) {
|
|
179
|
-
const flag = parseFlags[$0];
|
|
180
|
-
/**
|
|
181
|
-
* 搜索匹配到子串(e.g. yyyy)对应flag(fourDigits)的位置
|
|
182
|
-
* @function search 未匹配到时返回-1,即按位取反为0时表示没有对应的flag
|
|
183
|
-
*/
|
|
184
|
-
const index = dateStr.search(flag[0]);
|
|
185
|
-
if (!~index) {
|
|
186
|
-
isVaild = false;
|
|
187
|
-
} else {
|
|
188
|
-
/**
|
|
189
|
-
* 为避免重复返回,将已经返回的值result从dateStr中删除
|
|
190
|
-
*/
|
|
191
|
-
dateStr.replace(flag[0], function(result) {
|
|
192
|
-
flag[1](dateInfo, result);
|
|
193
|
-
dateStr = dateStr.substr(index + result.length);
|
|
194
|
-
return result;
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
return parseFlags[$0] ? "" : $0.slice(1, $0.length - 1);
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
if (!isVaild) {
|
|
202
|
-
return false;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
const date = new Date(
|
|
206
|
-
dateInfo.year || today.getFullYear(),
|
|
207
|
-
dateInfo.month || 0,
|
|
208
|
-
dateInfo.day || 1,
|
|
209
|
-
dateInfo.hour || 0,
|
|
210
|
-
dateInfo.minute || 0,
|
|
211
|
-
dateInfo.second || 0
|
|
212
|
-
);
|
|
213
|
-
return date;
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
export default {
|
|
217
|
-
format,
|
|
218
|
-
parse
|
|
219
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export const createFragment = data => {
|
|
2
|
-
const tableData = Object.keys(data).reduce(
|
|
3
|
-
(list, k) => (list.push({ key: k, val: data[k] }), list),
|
|
4
|
-
[]
|
|
5
|
-
);
|
|
6
|
-
const trs = tableData
|
|
7
|
-
.map(({ key, val }) => {
|
|
8
|
-
return `
|
|
9
|
-
<div class="row">
|
|
10
|
-
<span>${key}</span>
|
|
11
|
-
<span>${val}</span>
|
|
12
|
-
</div>
|
|
13
|
-
`;
|
|
14
|
-
})
|
|
15
|
-
.join("");
|
|
16
|
-
|
|
17
|
-
return `
|
|
18
|
-
<section class="v-track-table">
|
|
19
|
-
<div class="header">
|
|
20
|
-
<strong>key</strong>
|
|
21
|
-
<strong>value</strong>
|
|
22
|
-
</div>
|
|
23
|
-
${trs}
|
|
24
|
-
</section>
|
|
25
|
-
`;
|
|
26
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
moduleFileExtensions: ["js", "jsx", "json", "vue"],
|
|
3
|
-
transform: {
|
|
4
|
-
"^.+\\.vue$": "vue-jest",
|
|
5
|
-
".+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$":
|
|
6
|
-
"jest-transform-stub",
|
|
7
|
-
"^.+\\.jsx?$": "babel-jest"
|
|
8
|
-
},
|
|
9
|
-
transformIgnorePatterns: ["/node_modules/"],
|
|
10
|
-
moduleNameMapper: {
|
|
11
|
-
"^@/(.*)$": "<rootDir>/src/$1"
|
|
12
|
-
},
|
|
13
|
-
snapshotSerializers: ["jest-serializer-vue"],
|
|
14
|
-
testMatch: [
|
|
15
|
-
"**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"
|
|
16
|
-
],
|
|
17
|
-
testURL: "http://localhost/"
|
|
18
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "v-track",
|
|
3
|
-
"version": "0.8.10",
|
|
4
|
-
"description": "一个基于Vue指令的埋点插件",
|
|
5
|
-
"author": "LHammer <lhammer@qq.com>",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"serve": "vue-cli-service serve",
|
|
8
|
-
"dev": "cross-env NODE_ENV=development rollup --config build/rollup.config.es.js --watch",
|
|
9
|
-
"build": "NODE_ENV=production npm run build:es && npm run build:browser",
|
|
10
|
-
"build:browser": "rollup --config build/rollup.config.browser.js && npm run size",
|
|
11
|
-
"build:es": "rollup --config build/rollup.config.es.js",
|
|
12
|
-
"build:docs": "vue-cli-service build",
|
|
13
|
-
"test": "npm run lint && npm run test:unit",
|
|
14
|
-
"lint": "vue-cli-service lint",
|
|
15
|
-
"prepublishOnly": "npm run test && npm run build",
|
|
16
|
-
"size": "gzip-size dist/v-track.min.js",
|
|
17
|
-
"test:unit": "vue-cli-service test:unit"
|
|
18
|
-
},
|
|
19
|
-
"main": "dist/v-track.min.js",
|
|
20
|
-
"module": "dist/v-track.esm.js",
|
|
21
|
-
"dependencies": {},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@babel/core": "^7.4.3",
|
|
24
|
-
"@babel/plugin-proposal-class-properties": "^7.4.0",
|
|
25
|
-
"@babel/preset-env": "^7.4.3",
|
|
26
|
-
"@vue/cli-plugin-babel": "^3.5.0",
|
|
27
|
-
"@vue/cli-plugin-eslint": "^3.5.0",
|
|
28
|
-
"@vue/cli-plugin-unit-jest": "^3.5.3",
|
|
29
|
-
"@vue/cli-service": "^3.5.0",
|
|
30
|
-
"@vue/eslint-config-prettier": "^4.0.1",
|
|
31
|
-
"@vue/test-utils": "1.0.0-beta.29",
|
|
32
|
-
"babel-core": "7.0.0-bridge.0",
|
|
33
|
-
"babel-eslint": "^10.0.1",
|
|
34
|
-
"babel-jest": "^23.6.0",
|
|
35
|
-
"babel-plugin-component": "^1.1.1",
|
|
36
|
-
"cross-env": "^5.2.0",
|
|
37
|
-
"element-ui": "^2.9.1",
|
|
38
|
-
"eslint": "^5.8.0",
|
|
39
|
-
"eslint-plugin-vue": "^5.0.0",
|
|
40
|
-
"gzip-size-cli": "^3.0.0",
|
|
41
|
-
"highlight.js": "^9.15.6",
|
|
42
|
-
"rollup": "^1.9.0",
|
|
43
|
-
"rollup-plugin-babel": "^4.3.2",
|
|
44
|
-
"rollup-plugin-commonjs": "^9.3.4",
|
|
45
|
-
"rollup-plugin-node-resolve": "^4.2.1",
|
|
46
|
-
"rollup-plugin-replace": "^2.2.0",
|
|
47
|
-
"rollup-plugin-uglify": "^6.0.2",
|
|
48
|
-
"sass": "^1.18.0",
|
|
49
|
-
"sass-loader": "^7.1.0",
|
|
50
|
-
"vue": "^2.6.10",
|
|
51
|
-
"vue-router": "^3.0.4",
|
|
52
|
-
"vue-template-compiler": "^2.5.21"
|
|
53
|
-
},
|
|
54
|
-
"keywords": [
|
|
55
|
-
"vue",
|
|
56
|
-
"javascript",
|
|
57
|
-
"track",
|
|
58
|
-
"directive",
|
|
59
|
-
"plugin",
|
|
60
|
-
"vue-components"
|
|
61
|
-
],
|
|
62
|
-
"license": "MIT",
|
|
63
|
-
"repository": {
|
|
64
|
-
"type": "git",
|
|
65
|
-
"url": "https://github.com/l-hammer/v-track.git"
|
|
66
|
-
}
|
|
67
|
-
}
|
|
Binary file
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
-
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
7
|
-
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
|
8
|
-
<link href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/nord.min.css" rel="stylesheet">
|
|
9
|
-
<title>v-track</title>
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<noscript>
|
|
13
|
-
<strong>We're sorry but v-track doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
|
14
|
-
</noscript>
|
|
15
|
-
<div id="app"></div>
|
|
16
|
-
<!-- built files will be auto injected -->
|
|
17
|
-
</body>
|
|
18
|
-
</html>
|