From 77b08b15dbc772675912eb24d0ba72319687f865 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 23 Sep 2019 15:45:22 +0800 Subject: [PATCH] feat(ActionSheet): enable round by default (#4542) --- src/action-sheet/README.md | 2 +- src/action-sheet/README.zh-CN.md | 2 +- src/action-sheet/index.tsx | 7 +++++-- src/action-sheet/test/__snapshots__/index.spec.js.snap | 6 +++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/action-sheet/README.md b/src/action-sheet/README.md index f556467e2..3621aa6ab 100644 --- a/src/action-sheet/README.md +++ b/src/action-sheet/README.md @@ -99,7 +99,7 @@ export default { | title | Title | *string* | - | - | | cancel-text | Text of cancel button | *string* | - | - | | overlay | Whether to show overlay | *boolean* | `true` | - | -| round | Whether to show round corner | *boolean* | `false` | 2.0.9 | +| round | Whether to show round corner | *boolean* | `true` | 2.0.9 | | close-on-click-action | Whether to close when click action | *boolean* | `false` | - | | close-on-click-overlay | Whether to close when click overlay | *boolean* | `true` | - | | lazy-render | Whether to lazy render util appeared | *boolean* | `true` | - | diff --git a/src/action-sheet/README.zh-CN.md b/src/action-sheet/README.zh-CN.md index b06c6b2e5..31141524b 100644 --- a/src/action-sheet/README.zh-CN.md +++ b/src/action-sheet/README.zh-CN.md @@ -113,7 +113,7 @@ export default { | title | 标题 | *string* | - | - | | cancel-text | 取消按钮文字 | *string* | - | - | | overlay | 是否显示遮罩层 | *boolean* | `true` | - | -| round | 是否显示圆角 | *boolean* | `false` | 2.0.9 | +| round | 是否显示圆角 | *boolean* | `true` | 2.0.9 | | close-on-click-action | 是否在点击选项后关闭 | *boolean* | `false` | - | | close-on-click-overlay | 是否在点击遮罩层后关闭 | *boolean* | `true` | - | | lazy-render | 是否在显示弹层时才渲染节点 | *boolean* | `true` | - | diff --git a/src/action-sheet/index.tsx b/src/action-sheet/index.tsx index ed23b328a..d2e10c33b 100644 --- a/src/action-sheet/index.tsx +++ b/src/action-sheet/index.tsx @@ -22,8 +22,8 @@ export type ActionSheetItem = { }; export type ActionSheetProps = PopupMixinProps & { + round: boolean; title?: string; - round?: boolean; actions?: ActionSheetItem[]; duration: number; cancelText?: string; @@ -142,12 +142,15 @@ function ActionSheet( ActionSheet.props = { ...PopupMixin.props, title: String, - round: Boolean, actions: Array, duration: Number, cancelText: String, getContainer: [String, Function], closeOnClickAction: Boolean, + round: { + type: Boolean, + default: true + }, safeAreaInsetBottom: { type: Boolean, default: true diff --git a/src/action-sheet/test/__snapshots__/index.spec.js.snap b/src/action-sheet/test/__snapshots__/index.spec.js.snap index 718a1b99f..e371aed56 100644 --- a/src/action-sheet/test/__snapshots__/index.spec.js.snap +++ b/src/action-sheet/test/__snapshots__/index.spec.js.snap @@ -1,14 +1,14 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`callback events 1`] = ` -
`; -exports[`color option 1`] = `
`; +exports[`color option 1`] = `
`; -exports[`disable lazy-render 1`] = ``; +exports[`disable lazy-render 1`] = ``; exports[`render title and default slot 1`] = ``;