Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
477 views
in Technique[技术] by (71.8m points)

modjs加载模块zepto,报错Uncaught [ModJS] Cannot find module `Zepto`

在index.html文件中var $=require('Zepto');zepto或者Zepto或者zepto.js或者加了路径都不行,都会报错;
<script src="/static/lib/js/mod.js"></script>
<script>

        var $=require('Zepto');
         $(document).ready(function(){
            $('.container').hide();

                         });
    

</script>

加载模块,怎么调用这个zepto.js库,为什么不能正常引用   

clipboard.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

zepto不支持模块化的写法,包括AMD CMD规范等等,但是解决方法还是很多的,可以自己搜一下。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...