npm install
npm start
import React, { Component } from 'react'
import {
Container,
Group,
Button,
Slider
} from 'amazeui-touch'
const data = [
{
img:'http://qiniu-aladin.dlhis.com/aladin-v-0.0.1-tplView-tpl000012.jpg',
thumb:'http://qiniu-aladin.dlhis.com/aladin-v-0.0.1-tplView-tpl000012.jpg',
},
{
img:'http://qiniu-aladin.dlhis.com/aladin-v-0.0.1-tplView-tpl000011.jpg',
thumb:'http://qiniu-aladin.dlhis.com/aladin-v-0.0.1-tplView-tpl000011.jpg',
},
{
img:'http://qiniu-aladin.dlhis.com/aladin-v-0.0.1-tplView-tpl00003.jpg',
thumb:'http://qiniu-aladin.dlhis.com/aladin-v-0.0.1-tplView-tpl00003.jpg',
},
{
img:'http://qiniu-aladin.dlhis.com/aladin-v-0.0.1-tplView-tpl00005.jpg',
thumb:'http://qiniu-aladin.dlhis.com/aladin-v-0.0.1-tplView-tpl00005.jpg',
}
]
const sliderThumb = (
<Slider
directionNav = {false}
>
{data.map(function(item,i){
return (
<Slider.Item
key={i}
thumbnail={item.thumb}
>
<img src={item.img} />
</Slider.Item>
)
})}
</Slider>
)
export default class SliderCop extends Component {
constructor(props) {
super(props)
}
render() {
return (
<Container {...this.props}>
<Group>
{sliderThumb}
</Group>
</Container>
)
}
}
import React, {Component} from 'react'
import SliderCop from './components/slider/sliderCop.jsx'
export default class App extends Component{
render(){
return (
<div>
<SliderCop></SliderCop>
</div>
)
}
}
很多框架都有他自己的http交互方式,比如angular的$http,jQuery的$.ajax等等, 然而这些都是内嵌在框架内的,但是react没有,这样我们就可以自己来实现自己需要的ajax方式, 然后react他需要管的只是显示而已。。。。