mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(@vant/touch-emulator): add SSR support (#8767)
This commit is contained in:
parent
eeac061682
commit
35683a0d05
@ -4,6 +4,10 @@
|
|||||||
* Source:https://github.com/hammerjs/touchemulator
|
* Source:https://github.com/hammerjs/touchemulator
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
if (typeof window === 'undefined') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var eventTarget;
|
var eventTarget;
|
||||||
var supportTouch = 'ontouchstart' in window;
|
var supportTouch = 'ontouchstart' in window;
|
||||||
|
|
||||||
@ -195,3 +199,4 @@ TouchEmulator['multiTouchOffset'] = 75;
|
|||||||
if (!supportTouch) {
|
if (!supportTouch) {
|
||||||
new TouchEmulator();
|
new TouchEmulator();
|
||||||
}
|
}
|
||||||
|
})();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user