update readme

This commit is contained in:
dntzhang 2019-04-03 10:58:40 +08:00
parent ae920b43a3
commit e210417eb0
1 changed files with 71 additions and 0 deletions

View File

@ -10,3 +10,74 @@ Comi 读 ['kəʊmɪ],类似中文 科米,是腾讯 Omi 团队开发的小程
### 体验
![](https://github.com/Tencent/omi/raw/master/assets/omi-cloud.jpg)
### 使用
js:
```js
const comi = require('../../comi/comi.js');
Page({
onLoad: function () {
const md =`你也渲染的 md`;
comi(md, this)
}
})
```
wxml:
```html
<include src="../../comi/comi.wxml" />
```
wxss:
```css
@import "../../comi/comi.wxss";
```
简单把!
## 在 omip 中使用
js:
```jsx
import { WeElement, define } from 'omi'
import './index.css'
import comi from '../../components/comi/comi'
define('page-index', class extends WeElement {
install() {
const md =`你要渲染的 md`;
comi(md, this.$scope)
}
render() {
return (
<view>
<include src="../../components/comi/comi.wxml" />
</view>
)
}
})
```
css:
```
@import '../../components/comi/comi.wxss';
```
## 感谢
* wxParse
* remarkable
* html2json
* htmlparser
* prism