be-fe / iSlider

Smooth mobile touch slider for Mobile WebApp, HTML5 App, Hybrid App
http://be-fe.github.io/iSlider/
MIT License
1.65k stars 449 forks source link

2.2.2npm包使用问题 #415

Closed liu2080019 closed 7 years ago

liu2080019 commented 7 years ago

如题,我的配置如下 this.slider = new iSlider({ isAutoplay: true, duration: 500, isLooping: true, isOverspread: true, animateType: 'card', animateTime: 800, dom: this.slideRef, data: this._getDataSource(), plugins: [['dot']] }); 不自动播放,dot也不出现,看了一下npm包的引用 `// require('../build/iSlider.css'); // require("exports?iSlider!./export-iSlider"); var iSlider = require("../build/iSlider.js"); // require('../build/iSlider.animate'); // require('../build/iSlider.plugin.dot'); // require('../build/iSlider.plugin.button'); // require('../build/iSlider.plugin.BIZone'); // require('../build/iSlider.plugin.zoompic');

module.exports = iSlider;` 很多被注释了。。。请问npm引用的方式怎么玩……

shinate commented 7 years ago

这个是示例,去掉注释即可

liu2080019 commented 7 years ago

打开注释 var iSlider = require("../build/iSlider.js"); require('../build/iSlider.animate'); require('../build/iSlider.plugin.dot'); require('../build/iSlider.plugin.button'); 引用位置代码 import * as iSlider from 'islider.js'; 还是不生效。。