From c3bd24981c5967aa3020f6256fbcb566d57d2a1f Mon Sep 17 00:00:00 2001 From: dntzhang Date: Mon, 7 Jan 2019 18:49:59 +0800 Subject: [PATCH] update readme --- packages/omiu/README.md | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/packages/omiu/README.md b/packages/omiu/README.md index fda3c4a92..cccc7acf9 100644 --- a/packages/omiu/README.md +++ b/packages/omiu/README.md @@ -2,11 +2,48 @@ > Omi ui. -Simple UI framework, compatible with omi and omio. +Simple UI framework, compatible with omi and omio(IE8+), using the design style of Wechat 7.0. * [English Docs](https://tencent.github.io/omi/packages/omiu/examples/build/index.html) * [中文文档](https://tencent.github.io/omi/packages/omiu/examples/build/zh-cn.html) +## Use it immediately + +``` +npm i omi-cli -g +omi init my-app +cd my-app +npm start +npm run build +``` + +> `npx omi-cli init my-app` is also supported(npm v5.2.0+). + +## Use it in existing project + +```js +npm i omiu +``` + +```js +import { WeElement, define, render } from 'omi' +import 'omiu/button' + +define('my-app', class extends WeElement { + onClick = () => { + console.log('Hello omiu!'); + } + + render() { + return ( + I am button. + ) + } +}) + +render(, 'body') +``` + ## Development ```bash