omi/packages/omi-touch
张磊 69539dd763 update name 2018-11-01 15:08:40 +08:00
..
examples/simple update index.html 2018-11-01 15:06:19 +08:00
README.md update readme 2018-11-01 15:05:48 +08:00
index.js eslint 2018-11-01 15:04:37 +08:00
package.json update name 2018-11-01 15:08:40 +08:00
webpack.config.js omi-touch 2.0 2018-11-01 14:58:48 +08:00

README.md

omi-touch

Smooth scrolling, rotation, pull to refresh and any motion for the web.

→ touch the mobile demo

Usage

import { render, define, WeElement } from 'omi'
import 'omi-touch'

define('my-app', class extends WeElement {
  onChange = value => {
    console.log(value)
  }

  render() {
    return (
      <div class="main">
        <omi-touch min={-1750} max={0} change={this.onChange}>
          <div class="touchArea">
            <ul>
              <li>Hello, Omi-Touch!</li>
              <li>AlloyTouch</li>
              <li>Omi</li>
              ...
              ...
              ...
              <li> row 20</li>
              <li> row 21</li>
              <li> row 22</li>
              <li> row 23</li>
              <li> row 24</li>
              <li style="border-bottom: none;"> row 25</li>
            </ul>
          </div>
        </omi-touch>
      </div>
    )
  }
})

render(<my-app />, 'body')

License

MIT © dntzhang