- 传统页面:
<script src='path/fastclick.js'></script>
<script>
if ('addEventListener' in document) {
document.addEventListener('DOMContentLoaded', function() {
FastClick.attach(document.body);
}, false);
}
</script>
- vue页面:
npm install fastclick;
///先本地安装fastclick,再通过webpack打包入项目
import fastClick from 'fastClick';
fastClick.attach(document.body);