Skip to content

Commit

Permalink
Merge pull request #230 from FEMessage/dev
Browse files Browse the repository at this point in the history
release
  • Loading branch information
levy9527 authored Jul 20, 2022
2 parents 7d38645 + 1ffc521 commit 6a0c7dc
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@
"contributions": [
"bug"
]
},
{
"login": "chengaopan",
"name": "chengaopan",
"avatar_url": "https://avatars.githubusercontent.com/u/18641281?v=4",
"profile": "https://github.com/chengaopan",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
1 change: 1 addition & 0 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ el-data-table、el-data-tree 等组件内部集成该组件,用于更加灵活

## Links

- [钉钉交流群](https://github.com/FEMessage/el-data-table/issues/181)
- [api doc and online demo](https://femessage.github.io/el-form-renderer/)
- [自定义组件接入指南](https://github.com/femessage/el-form-renderer/blob/master/docs/guide-custom-component.md)
- [自定义组件设置校验规则](https://github.com/FEMessage/el-form-renderer/blob/master/docs/guide-custom-rules-in-custom-component.md)
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,26 @@ Please refer to our [contributing guide](https://github.com/FEMessage/.github/bl
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
<table><tr><td align="center"><a href="https://github.com/Alvin-Liu"><img src="https://avatars0.githubusercontent.com/u/11909145?v=4" width="100px;" alt="Alvin"/><br /><sub><b>Alvin</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/commits?author=Alvin-Liu" title="Code">💻</a> <a href="#review-Alvin-Liu" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/FEMessage/el-form-renderer/issues?q=author%3AAlvin-Liu" title="Bug reports">🐛</a> <a href="#blog-Alvin-Liu" title="Blogposts">📝</a> <a href="#ideas-Alvin-Liu" title="Ideas, Planning, & Feedback">🤔</a></td><td align="center"><a href="http://levy.work"><img src="https://avatars3.githubusercontent.com/u/9384365?v=4" width="100px;" alt="levy"/><br /><sub><b>levy</b></sub></a><br /><a href="#review-levy9527" title="Reviewed Pull Requests">👀</a> <a href="#infra-levy9527" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#ideas-levy9527" title="Ideas, Planning, & Feedback">🤔</a> <a href="#maintenance-levy9527" title="Maintenance">🚧</a></td><td align="center"><a href="https://evila.me"><img src="https://avatars3.githubusercontent.com/u/19513289?v=4" width="100px;" alt="EVILLT"/><br /><sub><b>EVILLT</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/commits?author=evillt" title="Code">💻</a> <a href="https://github.com/FEMessage/el-form-renderer/issues?q=author%3Aevillt" title="Bug reports">🐛</a> <a href="#blog-evillt" title="Blogposts">📝</a> <a href="#ideas-evillt" title="Ideas, Planning, & Feedback">🤔</a></td><td align="center"><a href="https://donaldshen.github.io/portfolio"><img src="https://avatars3.githubusercontent.com/u/19591950?v=4" width="100px;" alt="Donald Shen"/><br /><sub><b>Donald Shen</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/commits?author=donaldshen" title="Code">💻</a> <a href="https://github.com/FEMessage/el-form-renderer/commits?author=donaldshen" title="Documentation">📖</a> <a href="#example-donaldshen" title="Examples">💡</a> <a href="#blog-donaldshen" title="Blogposts">📝</a></td><td align="center"><a href="https://colmugx.github.io"><img src="https://avatars1.githubusercontent.com/u/21327913?v=4" width="100px;" alt="ColMugX"/><br /><sub><b>ColMugX</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/commits?author=colmugx" title="Code">💻</a> <a href="https://github.com/FEMessage/el-form-renderer/commits?author=colmugx" title="Tests">⚠️</a> <a href="https://github.com/FEMessage/el-form-renderer/commits?author=colmugx" title="Documentation">📖</a></td><td align="center"><a href="http://67.216.223.155/resume/"><img src="https://avatars3.githubusercontent.com/u/26338853?v=4" width="100px;" alt="OuZuYu"/><br /><sub><b>OuZuYu</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/issues?q=author%3AOuZuYu" title="Bug reports">🐛</a></td><td align="center"><a href="https://github.com/lianghx-319"><img src="https://avatars2.githubusercontent.com/u/27187946?v=4" width="100px;" alt="Han"/><br /><sub><b>Han</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/commits?author=lianghx-319" title="Code">💻</a> <a href="https://github.com/FEMessage/el-form-renderer/commits?author=lianghx-319" title="Documentation">📖</a></td></tr><tr><td align="center"><a href="https://github.com/yolofit"><img src="https://avatars1.githubusercontent.com/u/20294811?v=4" width="100px;" alt="yolofit"/><br /><sub><b>yolofit</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/issues?q=author%3Ayolofit" title="Bug reports">🐛</a></td></tr></table>
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/Alvin-Liu"><img src="https://avatars0.githubusercontent.com/u/11909145?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Alvin</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/commits?author=Alvin-Liu" title="Code">💻</a> <a href="https://github.com/FEMessage/el-form-renderer/pulls?q=is%3Apr+reviewed-by%3AAlvin-Liu" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/FEMessage/el-form-renderer/issues?q=author%3AAlvin-Liu" title="Bug reports">🐛</a> <a href="#blog-Alvin-Liu" title="Blogposts">📝</a> <a href="#ideas-Alvin-Liu" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="http://levy.work"><img src="https://avatars3.githubusercontent.com/u/9384365?v=4?s=100" width="100px;" alt=""/><br /><sub><b>levy</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/pulls?q=is%3Apr+reviewed-by%3Alevy9527" title="Reviewed Pull Requests">👀</a> <a href="#infra-levy9527" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#ideas-levy9527" title="Ideas, Planning, & Feedback">🤔</a> <a href="#maintenance-levy9527" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://evila.me"><img src="https://avatars3.githubusercontent.com/u/19513289?v=4?s=100" width="100px;" alt=""/><br /><sub><b>EVILLT</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/commits?author=evillt" title="Code">💻</a> <a href="https://github.com/FEMessage/el-form-renderer/issues?q=author%3Aevillt" title="Bug reports">🐛</a> <a href="#blog-evillt" title="Blogposts">📝</a> <a href="#ideas-evillt" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://donaldshen.github.io/portfolio"><img src="https://avatars3.githubusercontent.com/u/19591950?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Donald Shen</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/commits?author=donaldshen" title="Code">💻</a> <a href="https://github.com/FEMessage/el-form-renderer/commits?author=donaldshen" title="Documentation">📖</a> <a href="#example-donaldshen" title="Examples">💡</a> <a href="#blog-donaldshen" title="Blogposts">📝</a></td>
<td align="center"><a href="https://colmugx.github.io"><img src="https://avatars1.githubusercontent.com/u/21327913?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ColMugX</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/commits?author=colmugx" title="Code">💻</a> <a href="https://github.com/FEMessage/el-form-renderer/commits?author=colmugx" title="Tests">⚠️</a> <a href="https://github.com/FEMessage/el-form-renderer/commits?author=colmugx" title="Documentation">📖</a></td>
<td align="center"><a href="http://67.216.223.155/resume/"><img src="https://avatars3.githubusercontent.com/u/26338853?v=4?s=100" width="100px;" alt=""/><br /><sub><b>OuZuYu</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/issues?q=author%3AOuZuYu" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/lianghx-319"><img src="https://avatars2.githubusercontent.com/u/27187946?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Han</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/commits?author=lianghx-319" title="Code">💻</a> <a href="https://github.com/FEMessage/el-form-renderer/commits?author=lianghx-319" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/yolofit"><img src="https://avatars1.githubusercontent.com/u/20294811?v=4?s=100" width="100px;" alt=""/><br /><sub><b>yolofit</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/issues?q=author%3Ayolofit" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/chengaopan"><img src="https://avatars.githubusercontent.com/u/18641281?v=4?s=100" width="100px;" alt=""/><br /><sub><b>chengaopan</b></sub></a><br /><a href="https://github.com/FEMessage/el-form-renderer/commits?author=chengaopan" title="Code">💻</a></td>
</tr>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

Expand Down
4 changes: 4 additions & 0 deletions docs/checkbox-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export default {
{
id: 'city',
type: 'checkbox-group',
/**
* sytle 属性是为了满足 el-checkbox-button属性而设置,如果不需要使用el-radio-button这可不设置
*/
style: 'button',
label: 'city',
default: ['new york'],
options: [
Expand Down
4 changes: 4 additions & 0 deletions docs/radio-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export default {
id: 'city',
type: 'radio-group',
label: 'city',
/**
* sytle 属性是为了满足 el-radio-button属性而设置,如果不需要使用el-radio-button这可不设置
*/
style: 'button',
default: 'new york',
options: [
/**
Expand Down
22 changes: 19 additions & 3 deletions src/components/render-form-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,17 @@
:key="optionKey(opt) || index"
v-bind="opt"
/>
<!-- TODO: 支持 el-checkbox-button 变体 -->
<el-checkbox-button
v-else-if="data.type === 'checkbox-group' && data.style === 'button'"
:key="opt.value"
v-bind="opt"
:label="'value' in opt ? opt.value : opt.label"
>
{{ opt.label }}
</el-checkbox-button>

<el-checkbox
v-else-if="data.type === 'checkbox-group'"
v-else-if="data.type === 'checkbox-group' && data.style !== 'button'"
:key="opt.value"
v-bind="opt"
:label="'value' in opt ? opt.value : opt.label"
Expand All @@ -56,8 +64,16 @@
</el-checkbox>
<!-- WARNING: radio 用 label 属性来表示 value 的含义 -->
<!-- FYI: radio 的 value 属性可以在没有 radio-group 时用来关联到同一个 v-model -->
<el-radio-button
v-else-if="data.type === 'radio-group' && data.style === 'button'"
:key="opt.label"
v-bind="opt"
:label="'value' in opt ? opt.value : opt.label"
>{{ opt.label }}</el-radio-button
>

<el-radio
v-else-if="data.type === 'radio-group'"
v-else-if="data.type === 'radio-group' && data.style !== 'button'"
:key="opt.label"
v-bind="opt"
:label="'value' in opt ? opt.value : opt.label"
Expand Down

0 comments on commit 6a0c7dc

Please sign in to comment.