Skip to content

Commit

Permalink
文档更新,版本升级
Browse files Browse the repository at this point in the history
  • Loading branch information
shixing.peng committed Sep 15, 2022
1 parent 79560cb commit 5cf7111
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# taro-form
仿照 ant design 的form设计的taro表单
仿照 ant design 的form设计的taro表单,理论上和taro保持一致的兼容性,目前已验证微信小程序和h5

## 使用方式
直接在项目中按如下方式引入即可
1. 直接在项目中按如下方式引入
```jsx
import Form, { FormSwitch, ... } from 'fe-taro-form';
/**
Expand All @@ -20,6 +20,17 @@ import 'fe-taro-form/dist/index.css';
</Form>
...
```
2. 配置需要额外的经由 Taro 预设的 postcss 编译的模块。
```js
module.exports = {
// ...
h5: {
// ...
// 经过这一配置之后,代码中引入的处于 `node_modules/fe-taro-form/` 路径下的样式文件均会经过 postcss 的编译处理。
esnextModules: ['fe-taro-form']
}
}
```
## class 组件及 function 组件各自获取ref的方式
### 1. class 组件
Expand Down
1 change: 1 addition & 0 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const config = {
}
}
},
/** https://taro-docs.jd.com/taro/docs/config-detail#h5esnextmodules */
esnextModules: ['taro-ui', 'fe-taro-form']
},
rn: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fe-taro-form",
"version": "0.1.2",
"version": "0.1.4",
"private": false,
"description": "仿照 ant design 的form设计的taro表单",
"author": "pengshixing",
Expand Down

0 comments on commit 5cf7111

Please sign in to comment.