1.0.7 • Published 6 years ago

aotoo-mixins-iscroll v1.0.7

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

aotoo-mixins-iscroll

mixin iscroll, Integrated the iscroll library to aotoo

Dependencies

Install

// install
npm install aotoo-common
npm install aotoo-mixins-iscroll --save

Usage

require('aotoo-mixins-scroll')

// inject css into head
Aotoo.inject.css( `
  .iscrollBox{
    height: 400px;
    overflow: hidden;
  }
`)

/*
 I. listTest.render() is a jsx  
 
 II. listTest.render(id) will mount jsx into the dom about that id, like React.render(...)  
 
 III. listTest.render(id, callback)  callback will be executed after jsx be mounted into the dom about that id  
*/
const listData = {
  data: [
    {title: '1111'},
    {title: '2222'},
    {title: '1111'},
    {title: '2222'},
    {title: '1111'},
    {title: '2222'},
    {title: '1111'},
    {title: '2222'},
    {title: '1111'},
    {title: '2222'},
    {title: '1111'},
    {title: '2222'},
    {title: <div className="img">abcdefg</div>},
    {title: '2222'},
    {title: '1111'},
    {title: '2222'},
    {title: '3333'} 
  ]
}

const IscrollList = Aotoo.iscroll((
  <div className='iscrollBox'>
    <Aotoo.list data={listData}/>
  </div>
), {
  elements: '.img',
  onscroll: function(lazy, direction){
    console.log('====== 1111');
  },
  onscrollend: function(lazy) {
    console.log('====== 2222');
  }
})

Aotoo.render(<IscrollList />, 'test')
1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago