react-weui icon indicating copy to clipboard operation
react-weui copied to clipboard

InfiniteLoader和Page组件的onLoadMore方法没有被调用

Open cryptopeng opened this issue 8 years ago • 7 comments

版本:[email protected] InfiniteLoader组件的onLoadMore\ onScroll方法都没有被调用。 代码直接使用的doc里面的example: `import React from 'react'; import ReactDOM from 'react-dom'; import { InfiniteLoader, Cells, CellsTitle, Cell, CellBody, CellFooter } from '../../../build/packages'; import Page from '../../component/page';

class InfiniteDemo extends React.Component {

constructor(props){
    super(props)

    this.state = {
        items: [...Array(20).keys()]
    }
}

render(){
    return (
        <InfiniteLoader
            onLoadMore={ (resolve, finish) => {
                //mock request
                setTimeout( ()=> {
                    if(this.state.items.length > 22){
                        finish()
                    }else{
                        this.setState({
                            items: this.state.items.concat([this.state.items.length])
                        }, ()=> resolve())
                    }
                }, 1000)
            }}
        >
        <Page className="infinite" title="Infinite Loader" subTitle="滚动加载" >

                <CellsTitle>List with 22 Max</CellsTitle>
                <Cells>
                {
                    this.state.items.map( (item, i) => {
                        return (
                            <Cell href="javascript:;" key={i} access>
                                <CellBody>
                                    {item}
                                </CellBody>
                                <CellFooter/>
                            </Cell>
                        )
                    })
                }
                </Cells>

        </Page>
        </InfiniteLoader>
    )
}

}

export default InfiniteDemo;`

cryptopeng avatar Aug 22 '17 23:08 cryptopeng

Me too

rmbadmin avatar Aug 26 '17 06:08 rmbadmin

Me too

w231324746 avatar Sep 01 '17 08:09 w231324746

me too...

choleece avatar Sep 05 '17 13:09 choleece

me too

laichuangchong avatar Oct 25 '17 09:10 laichuangchong

me too

SimGyun avatar Nov 14 '17 07:11 SimGyun

+1

coolguy001tv avatar Nov 21 '17 09:11 coolguy001tv

import 'weui'; import 'react-weui/build/packages/react-weui.css'; 加上这两句就好了,我前面是用自己编译的weui,就不行

menthe avatar Nov 27 '17 08:11 menthe