mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-24 15:39:15 +08:00
feat(ActionSheet): enable round by default (#4542)
This commit is contained in:
parent
9e1758c1d8
commit
77b08b15db
@ -99,7 +99,7 @@ export default {
|
|||||||
| title | Title | *string* | - | - |
|
| title | Title | *string* | - | - |
|
||||||
| cancel-text | Text of cancel button | *string* | - | - |
|
| cancel-text | Text of cancel button | *string* | - | - |
|
||||||
| overlay | Whether to show overlay | *boolean* | `true` | - |
|
| 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-action | Whether to close when click action | *boolean* | `false` | - |
|
||||||
| close-on-click-overlay | Whether to close when click overlay | *boolean* | `true` | - |
|
| close-on-click-overlay | Whether to close when click overlay | *boolean* | `true` | - |
|
||||||
| lazy-render | Whether to lazy render util appeared | *boolean* | `true` | - |
|
| lazy-render | Whether to lazy render util appeared | *boolean* | `true` | - |
|
||||||
|
@ -113,7 +113,7 @@ export default {
|
|||||||
| title | 标题 | *string* | - | - |
|
| title | 标题 | *string* | - | - |
|
||||||
| cancel-text | 取消按钮文字 | *string* | - | - |
|
| cancel-text | 取消按钮文字 | *string* | - | - |
|
||||||
| overlay | 是否显示遮罩层 | *boolean* | `true` | - |
|
| overlay | 是否显示遮罩层 | *boolean* | `true` | - |
|
||||||
| round | 是否显示圆角 | *boolean* | `false` | 2.0.9 |
|
| round | 是否显示圆角 | *boolean* | `true` | 2.0.9 |
|
||||||
| close-on-click-action | 是否在点击选项后关闭 | *boolean* | `false` | - |
|
| close-on-click-action | 是否在点击选项后关闭 | *boolean* | `false` | - |
|
||||||
| close-on-click-overlay | 是否在点击遮罩层后关闭 | *boolean* | `true` | - |
|
| close-on-click-overlay | 是否在点击遮罩层后关闭 | *boolean* | `true` | - |
|
||||||
| lazy-render | 是否在显示弹层时才渲染节点 | *boolean* | `true` | - |
|
| lazy-render | 是否在显示弹层时才渲染节点 | *boolean* | `true` | - |
|
||||||
|
@ -22,8 +22,8 @@ export type ActionSheetItem = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type ActionSheetProps = PopupMixinProps & {
|
export type ActionSheetProps = PopupMixinProps & {
|
||||||
|
round: boolean;
|
||||||
title?: string;
|
title?: string;
|
||||||
round?: boolean;
|
|
||||||
actions?: ActionSheetItem[];
|
actions?: ActionSheetItem[];
|
||||||
duration: number;
|
duration: number;
|
||||||
cancelText?: string;
|
cancelText?: string;
|
||||||
@ -142,12 +142,15 @@ function ActionSheet(
|
|||||||
ActionSheet.props = {
|
ActionSheet.props = {
|
||||||
...PopupMixin.props,
|
...PopupMixin.props,
|
||||||
title: String,
|
title: String,
|
||||||
round: Boolean,
|
|
||||||
actions: Array,
|
actions: Array,
|
||||||
duration: Number,
|
duration: Number,
|
||||||
cancelText: String,
|
cancelText: String,
|
||||||
getContainer: [String, Function],
|
getContainer: [String, Function],
|
||||||
closeOnClickAction: Boolean,
|
closeOnClickAction: Boolean,
|
||||||
|
round: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
safeAreaInsetBottom: {
|
safeAreaInsetBottom: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`callback events 1`] = `
|
exports[`callback events 1`] = `
|
||||||
<div class="van-popup van-popup--bottom van-popup--safe-area-inset-bottom van-action-sheet" name="van-popup-slide-bottom"><button class="van-action-sheet__item van-hairline--top"><span class="van-action-sheet__name">Option</span></button><button class="van-action-sheet__item van-action-sheet__item--disabled van-hairline--top"><span class="van-action-sheet__name">Option</span></button><button class="van-action-sheet__item van-action-sheet__item--disabled van-hairline--top">
|
<div class="van-popup van-popup--round van-popup--bottom van-popup--safe-area-inset-bottom van-action-sheet" name="van-popup-slide-bottom"><button class="van-action-sheet__item van-hairline--top"><span class="van-action-sheet__name">Option</span></button><button class="van-action-sheet__item van-action-sheet__item--disabled van-hairline--top"><span class="van-action-sheet__name">Option</span></button><button class="van-action-sheet__item van-action-sheet__item--disabled van-hairline--top">
|
||||||
<div class="van-loading van-loading--circular"><span class="van-loading__spinner van-loading__spinner--circular" style="color: rgb(201, 201, 201); width: 20px; height: 20px;"><svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div>
|
<div class="van-loading van-loading--circular"><span class="van-loading__spinner van-loading__spinner--circular" style="color: rgb(201, 201, 201); width: 20px; height: 20px;"><svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div>
|
||||||
</button><button class="van-action-sheet__item van-hairline--top"><span class="van-action-sheet__name">Option</span><span class="van-action-sheet__subname">Subname</span></button><button class="van-action-sheet__cancel">Cancel</button></div>
|
</button><button class="van-action-sheet__item van-hairline--top"><span class="van-action-sheet__name">Option</span><span class="van-action-sheet__subname">Subname</span></button><button class="van-action-sheet__cancel">Cancel</button></div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`color option 1`] = `<div class="van-popup van-popup--bottom van-popup--safe-area-inset-bottom van-action-sheet" name="van-popup-slide-bottom"><button class="van-action-sheet__item van-hairline--top" style="color: red;"><span class="van-action-sheet__name">Option</span></button></div>`;
|
exports[`color option 1`] = `<div class="van-popup van-popup--round van-popup--bottom van-popup--safe-area-inset-bottom van-action-sheet" name="van-popup-slide-bottom"><button class="van-action-sheet__item van-hairline--top" style="color: red;"><span class="van-action-sheet__name">Option</span></button></div>`;
|
||||||
|
|
||||||
exports[`disable lazy-render 1`] = `<div class="van-popup van-popup--bottom van-popup--safe-area-inset-bottom van-action-sheet" style="display: none;" name="van-popup-slide-bottom"><button class="van-action-sheet__item van-hairline--top"><span class="van-action-sheet__name">Option</span></button><button class="van-action-sheet__item van-hairline--top"><span class="van-action-sheet__name">Option</span></button><button class="van-action-sheet__cancel">Cancel</button></div>`;
|
exports[`disable lazy-render 1`] = `<div class="van-popup van-popup--round van-popup--bottom van-popup--safe-area-inset-bottom van-action-sheet" style="display: none;" name="van-popup-slide-bottom"><button class="van-action-sheet__item van-hairline--top"><span class="van-action-sheet__name">Option</span></button><button class="van-action-sheet__item van-hairline--top"><span class="van-action-sheet__name">Option</span></button><button class="van-action-sheet__cancel">Cancel</button></div>`;
|
||||||
|
|
||||||
exports[`render title and default slot 1`] = ``;
|
exports[`render title and default slot 1`] = ``;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user