From 06c3241cd11b7dcb27c1599273652b66e9386f5e Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Mon, 11 May 2020 20:20:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=AE=E5=89=8D=E7=9C=8B=E6=9D=A5=20Repeat?= =?UTF-8?q?=20=E7=BB=84=E4=BB=B6=E6=9C=89=E7=82=B9=E5=A4=9A=E4=BD=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/components/Form/Full.jsx | 40 ++++++++++++++++++++++++++++--- scss/_utilities.scss | 3 +-- src/components/Select.tsx | 1 + src/renderers/Form/Group.tsx | 5 ++-- src/renderers/Form/Repeat.tsx | 4 +++- src/utils/helper.ts | 4 ++-- 6 files changed, 47 insertions(+), 10 deletions(-) diff --git a/examples/components/Form/Full.jsx b/examples/components/Form/Full.jsx index ca22c3f2..a0cf5a89 100644 --- a/examples/components/Form/Full.jsx +++ b/examples/components/Form/Full.jsx @@ -775,9 +775,43 @@ export default { type: 'divider' }, { - type: 'repeat', - name: 'repeat', - label: '时间频率' + label: '时间频率', + type: 'group', + controls: [ + { + name: 'repeatCount', + type: 'range', + label: false, + visibleOn: 'data.repeatUnit != "none"' + }, + + { + type: 'select', + name: 'repeatUnit', + label: false, + value: 'none', + mode: 'inline', + columnClassName: 'v-middle no-grow', + options: [ + { + label: '不重复', + value: 'none' + }, + { + label: '年', + value: 'year' + }, + { + label: '月', + value: 'month' + }, + { + label: '日', + value: 'day' + } + ] + } + ] }, { type: 'divider' diff --git a/scss/_utilities.scss b/scss/_utilities.scss index e3426ff1..94a0c48c 100644 --- a/scss/_utilities.scss +++ b/scss/_utilities.scss @@ -1304,9 +1304,8 @@ } .v-middle { - // display: inline-flex; - // align-items: center; vertical-align: middle !important; + align-self: center; } .scrollable { diff --git a/src/components/Select.tsx b/src/components/Select.tsx index 7127476a..b6f6e1a4 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -36,6 +36,7 @@ export interface Option { export interface Options extends Array