Skip to content

Commit

Permalink
touchPoint supports PC browser
Browse files Browse the repository at this point in the history
  • Loading branch information
jaweii committed Jun 17, 2017
1 parent 76d7745 commit d1b6650
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,19 @@ transition.install = (Vue, router, options = {}) => {
}, op.firstEntryDuration * 1000);
}

document.addEventListener('mousedown', getCoord)
document.addEventListener('touchstart', getCoord)
// document.addEventListener('click', getCoord)

//获得按下坐标
function getCoord(e) {
coord.x = e.touches[0].clientX
coord.y = e.touches[0].clientY
if (e.type === 'mousedown') {
coord.x = e.clientX
coord.y = e.clientY
} else {
coord.x = e.touches[0].clientX
coord.y = e.touches[0].clientY
}

}


Expand Down

0 comments on commit d1b6650

Please sign in to comment.