update site

This commit is contained in:
dntzhang 2019-03-14 12:07:04 +08:00
parent 279b85390f
commit 1d0c94dd98
2 changed files with 96 additions and 24 deletions

View File

@ -1,24 +0,0 @@
## Input
用户的输入框,输入一些内容用来提交给服务器。
## 使用
```js
<o-input placeholder="请输入用户名" />
```
## API
### Props
| **Name** | **Type** | **Defaults** | **Details** |
| ------------- |:-------------:|:-----:|:-------------:|
| placeholder | string| | 占位字符串 |
## 其他类型
```js
<o-input-label label='UserName' />
<o-input-button buttonText='提交' onClick={this.onClick} />
```

View File

@ -0,0 +1,96 @@
## 安装
直接下载并用 <script> Omi
* [Omi 开发版本](https://unpkg.com/omi@latest/dist/omi.js)
* [Omi 压缩版本](https://unpkg.com/omi@latest/dist/omi.min.js)
* [Omio 开发版本](https://unpkg.com/omio@latest/dist/omi.js)
* [Omio 压缩版本](https://unpkg.com/omi@latest/dist/omi.min.js)
也可以通过 npm 安装
```
npm i omi
```
如果需要兼容 IE8+,可以选择 omio它拥有和 omi 几乎一样的 API且 Omi 也会被注册为一个全局变量。
* [Omio 开发版本](https://unpkg.com/omio@latest/dist/omi.js)
* [Omio 压缩版本](https://unpkg.com/omi@latest/dist/omi.min.js)
或者
```
npm i omio
```
## CLI
## omi-cli
```bash
$ npm i omi-cli -g # install cli
$ omi init my-app # init project
$ cd my-app
$ npm start # develop
$ npm run build # release
```
> `npx omi-cli init my-app` is also supported(npm v5.2.0+).
Directory description:
```
├─ config
├─ public
├─ scripts
├─ src
│ ├─ assets
│ ├─ elements //Store all custom elements
│ ├─ store //Store all this store of pages
│ ├─ admin.js //Entry js of compilerwill build to admin.html
│ └─ index.js //Entry js of compilerwill build to index.html
```
About compiled website URL
* [build env doc](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#referencing-environment-variables-in-the-html)
* [build problem](https://stackoverflow.com/questions/42686149/create-react-app-build-with-public-url)
Such as in windows:
```json
"scripts": {
"start": "node scripts/start.js",
"_build": "node scripts/build.js",
"build":"set PUBLIC_URL=https://fe.wxpay.oa.com/dv&& npm run _build"
}
```
In mac os:
```json
"scripts": {
"start": "node scripts/start.js",
"_build": "node scripts/build.js",
"build":"PUBLIC_URL=https://fe.wxpay.oa.com/dv npm run _build",
"fix": "eslint src --fix"
},
```
## Project Template
| **Template Type**| **Command**| **Describe**|
| ------------ | -----------| ----------------- |
|Base Template(v3.3.0+)|`omi init my-app`| Basic omi or omio(IE8+) project template.|
|小程序模板(v3.3.5+)|`omi init-p my-app`| Omi 开发小程序 |
|Base Template with snapshoot|`omi init-snap my-app`| Basic omi or omio(IE8+) project template with snapshoot prerendering.|
|TypeScript Template(omi-cli v3.3.0+)|`omi init-ts my-app`|Basic template with typescript.|
|Mobile Template|`omi init-weui my-app`| Mobile web app template with weui and omi-router.|
|omi-mp Template(omi-cli v3.0.13+)|`omi init-mp my-app` |Developing web with mini program template.|
|MVVM Template(omi-cli v3.0.22+)|`omi init-mvvm my-app` |MVVM template.|
<!-- |[SPA Template](https://tencent.github.io/omi/packages/omi-router/examples/spa/build/)(omi-cli v3.0.10+)|`omi init-spa my-app`|Single page application template with omi-router.| -->
CLI's auto-created project scaffolding is based on a single-page create-react-app to be converted into a multi-page one, with configuration issues to see [create-react-app user guide](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md)