[英]Javascript method call in requirejs project
我试图从我项目的任何地方找到解决方法JavaScript方法调用。 我正在使用requirejs加载javascript库。
require.config({
paths: {
fastclick: "Vendors/fastclick/lib/fastclick.js",
},
//Mention the dependencies
shim: {
fastclick: {
exports: "FastClick"
},
在这里我想这样调用初次点击的方法
FastClick.attach(tElement);
我不想使用requirejs define('')
这是一种无需define
即可使用的方法:
require(["fastclick"], function () {
// The shimmed module leaks `FastClick` to the global space, so this will
// work.
FastClick.attach(tElement);
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.