omi/packages/omio
dntzhang a4e2cf75c4 omio - build v2.1.0 2019-03-28 16:35:21 +08:00
..
assets rename omi-old to omio 2018-12-13 13:19:16 +08:00
config omio - add babel plugin 2019-01-19 10:59:19 +08:00
debug rename omi-old to omio 2018-12-13 13:19:16 +08:00
devtools rename omi-old to omio 2018-12-13 13:19:16 +08:00
dist omio - build v2.1.0 2019-03-28 16:35:21 +08:00
examples omio - fix path updating 2019-03-14 17:49:06 +08:00
src omio - update output of renderToString and add merge method 2019-03-28 16:32:39 +08:00
test omio - update output of renderToString and add merge method 2019-03-28 16:32:39 +08:00
.babelrc rename omi-old to omio 2018-12-13 13:19:16 +08:00
.editorconfig omio - add prettier 2018-12-13 14:39:01 +08:00
.eslintignore omio - add prettier 2018-12-13 14:39:01 +08:00
.eslintrc omio - add prettier 2018-12-13 14:39:01 +08:00
.flowconfig rename omi-old to omio 2018-12-13 13:19:16 +08:00
.gitignore rename omi-old to omio 2018-12-13 13:19:16 +08:00
README.CN.md update readme 2019-01-12 18:58:36 +08:00
README.KR.md omio - remove staticCss, add dynamicCss 2018-12-28 09:00:10 +08:00
README.md Update README.md 2019-01-12 06:10:32 +08:00
package.json omio - update output of renderToString and add merge method 2019-03-28 16:32:39 +08:00
typings.json rename omi-old to omio 2018-12-13 13:19:16 +08:00

README.md

English | 简体中文 | 한국어

Omio

Omi for old browsers(IE8+ and mobile browsers)


Use immediately

$ npm i omi-cli -g             
$ omi init my-app   
$ cd my-app           
$ npm start                     
$ npm run build               

Required omi-cli v3.3.0+.

Differences to omi

Omio has the same grammar as omi, but there are also some differences:

  • Omio does not support slot, please use props.children instead like react

Use in omi project

npm i omio

Omiu

Omi ui.

Simple UI framework, compatible with omi and omio.

Webpack Alias

If you want to use omio under existing omi projects, no code changes are required through the following configuration:

module.exports = {
  //...
  resolve: {
    alias: {
      omi: 'omio'
    }
  }
};

Support IE8

import { render, WeElement, define } from '../../src/omi'

define('my-counter', class extends WeElement {
  //commented out for ie8
  //static observe = true

  data = {
    count: 1
  }

  sub = () => {
    this.data.count--
    //no observe, so call this.update for ie8
    this.update()
  }

  add = () => {
    this.data.count++
    //no observe, so call this.update for ie8
    this.update()
  }

  render() {
    return (
      <div>
        <button onClick={this.sub}>-</button>
        <span>{this.data.count}</span>
        <button onClick={this.add}>+</button>
      </div>
    )
  }
})

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

If you only need to be compatible with IE9 and IE9+you can use static observe = true.

License

MIT © dntzhang