mirror of
				https://gitee.com/vant-contrib/vant.git
				synced 2025-11-04 21:02:09 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			522 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			522 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
# Vant Touch Emulator
 | 
						|
 | 
						|
在桌面端上模拟移动端 touch 事件,实现方式来自于 [hammerjs/touchemulator](https://github.com/hammerjs/touchemulator).
 | 
						|
 | 
						|
## Install
 | 
						|
 | 
						|
#### NPM
 | 
						|
 | 
						|
```shell
 | 
						|
npm i @vant/touch-emulator -S
 | 
						|
```
 | 
						|
 | 
						|
#### YARN
 | 
						|
 | 
						|
```shell
 | 
						|
yarn add @vant/touch-emulator
 | 
						|
```
 | 
						|
 | 
						|
## 使用指南
 | 
						|
 | 
						|
直接在代码中引入模块即可,模块会自动完成初始化并生效
 | 
						|
 | 
						|
```js
 | 
						|
import '@vant/touch-emulator';
 | 
						|
```
 | 
						|
 | 
						|
## CDN 引入
 | 
						|
 | 
						|
```html
 | 
						|
<script src="https://cdn.jsdelivr.net/npm/@vant/touch-emulator"></script>
 | 
						|
```
 |