Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rip
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fanxuehui
rip
Commits
517bb785
Commit
517bb785
authored
Aug 16, 2019
by
fanxuehui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(错误的关闭监听):
parent
20ba8952
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
README.md
README.md
+0
-1
monitor.js
src/lib/monitor.js
+2
-2
No files found.
README.md
View file @
517bb785
...
@@ -16,5 +16,4 @@
...
@@ -16,5 +16,4 @@
### 发布
### 发布
-
npm run build
-
npm run build
-
安全性考虑,需要手动上传
`[hash].worker.js`
文件到苍穹,路径为
`/tuia/rip/`
-
npm publish
-
npm publish
src/lib/monitor.js
View file @
517bb785
...
@@ -57,11 +57,12 @@ class Monitor {
...
@@ -57,11 +57,12 @@ class Monitor {
window
.
addEventListener
(
"hashchange"
,
()
=>
{
window
.
addEventListener
(
"hashchange"
,
()
=>
{
// 忽略hash后的query
// 忽略hash后的query
let
hash
=
getPureHash
(
location
.
hash
);
let
hash
=
getPureHash
(
location
.
hash
);
if
(
hash
===
preHash
)
return
;
if
(
hash
===
preHash
)
return
console
.
log
(
'hash query 无变化,no reset'
);
;
preHash
=
hash
;
preHash
=
hash
;
//防抖,防止无效的频繁触发
//防抖,防止无效的频繁触发
clearTimeout
(
timer
);
clearTimeout
(
timer
);
timer
=
setTimeout
(()
=>
{
timer
=
setTimeout
(()
=>
{
console
.
log
(
'hashchange reset'
);
this
.
reset
({
path
:
location
.
hash
});
this
.
reset
({
path
:
location
.
hash
});
},
1000
);
},
1000
);
});
});
...
@@ -82,7 +83,6 @@ class Monitor {
...
@@ -82,7 +83,6 @@ class Monitor {
* @param {*} event
* @param {*} event
*/
*/
reset
(
event
)
{
reset
(
event
)
{
this
.
resetRrwebHandler
();
console
.
log
(
"重置数据"
);
console
.
log
(
"重置数据"
);
this
.
tracksWorker
.
postMessage
({
type
:
"reset"
,
payload
:
event
});
this
.
tracksWorker
.
postMessage
({
type
:
"reset"
,
payload
:
event
});
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment