简体   繁体   English

ReactJS Nuke轮播

[英]ReactJS nuke carousel

I am interested in getting this react js nuke carousel working. 我有兴趣让此React js nuke轮播工作。 https://github.com/kenwheeler/nuka-carousel https://github.com/kenwheeler/nuka-carousel

//jsfiddle https://jsfiddle.net/7xzd92s5/6/ // jsfiddle https://jsfiddle.net/7xzd92s5/6/

Is there a cdn I could tap into to load in the module? 我可以使用CDN载入模块吗?

var Carousel = require('nuka-carousel');

var CarouselApp = React.createClass({
  mixins: [Carousel.ControllerMixin],
  render() {
    return (
      <Carousel>
        <img src="http://placehold.it/1000x400/ffffff/c0392b/&text=slide1"/>
        <img src="http://placehold.it/1000x400/ffffff/c0392b/&text=slide2"/>
        <img src="http://placehold.it/1000x400/ffffff/c0392b/&text=slide3"/>
        <img src="http://placehold.it/1000x400/ffffff/c0392b/&text=slide4"/>
        <img src="http://placehold.it/1000x400/ffffff/c0392b/&text=slide5"/>
        <img src="http://placehold.it/1000x400/ffffff/c0392b/&text=slide6"/>
      </Carousel>
    )
  }
});


ReactDOM.render(
  <CarouselApp name="CarouselApp" />,
  document.getElementById('CarouselApp')
);

You write: 你写:

var Carousel = require('nuka-carousel') var Carousel = require('nuka-carousel')

But there are no 'nuka-carousel' library installed on jsfiddle server. 但是jsfiddle服务器上没有安装“ nuka-carousel”库。 You need to load 'nuka-carousel' from external dependency as babel like this: 您需要像这样的babel从外部依赖项加载“ nuka-carousel”:

<script src="https://facebook.github.io/react/js/jsfiddle-integration-babel.js"></script>

And there is no require function defined in jsfiddle-integration-babel.js jsfiddle-integration-babel.js中没有定义require函数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM