问题:根据文档引入fastclick报错。
var attachFastClick = require('fastclick');
attachFastClick(document.body);
问题:根据文档引入fastclick报错。
var attachFastClick = require('fastclick');
attachFastClick(document.body);
https://github.com/ftlabs/fas...
If you're using Browserify or another CommonJS-style module system, the FastClick.attach function will be returned when you call require('fastclick'). As a result, the easiest way to use FastClick with these loaders is as follows:
var attachFastClick = require('fastclick');
attachFastClick(document.body);
如果在打包工具中,应该CMD模块模式写法:
var attachFastClick = require('fastclick');
attachFastClick(document.body);
如果事script引用 ,使用AMD 模式的写法:
var FastClick = require('fastclick');
FastClick.attach(document.body, options);
如果有帮助,请采纳
10 回答11.2k 阅读
5 回答4.8k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答2.7k 阅读✓ 已解决
3 回答2.3k 阅读✓ 已解决
3 回答2.2k 阅读✓ 已解决
2 回答2.6k 阅读✓ 已解决