feat(ActionSheet): add round prop (#2080)

This commit is contained in:
neverland 2019-09-23 16:31:33 +08:00 committed by GitHub
parent cdd65163d1
commit 086a5f9ff6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 22 deletions

View File

@ -7,24 +7,13 @@ Page({
show3: false, show3: false,
show4: false, show4: false,
action1: [ action1: [
{ { name: '选项' },
name: '选项' { name: '选项' },
}, { name: '选项', subname: '描述信息' }
{
name: '选项'
},
{
name: '选项',
subname: '描述信息'
}
], ],
action2: [ action2: [
{ { name: '选项', color: '#07c160' },
name: '选项' { loading: true },
},
{
loading: true
},
{ name: '禁用选项', disabled: true } { name: '禁用选项', disabled: true }
] ]
}, },
@ -49,5 +38,5 @@ Page({
toggleActionSheet4() { toggleActionSheet4() {
this.toggle('show4'); this.toggle('show4');
}, }
}); });

View File

@ -1,5 +1,5 @@
<demo-block title="基础用法" padding> <demo-block title="基础用法" padding>
<van-button bind:click="toggleActionSheet1">弹出菜单</van-button> <van-button type="primary" bind:click="toggleActionSheet1">弹出菜单</van-button>
<van-action-sheet <van-action-sheet
show="{{ show1 }}" show="{{ show1 }}"
actions="{{ action1 }}" actions="{{ action1 }}"
@ -9,11 +9,10 @@
</demo-block> </demo-block>
<demo-block title="选项状态" padding> <demo-block title="选项状态" padding>
<van-button bind:click="toggleActionSheet2">弹出菜单</van-button> <van-button type="primary" bind:click="toggleActionSheet2">弹出菜单</van-button>
<van-action-sheet <van-action-sheet
show="{{ show2 }}" show="{{ show2 }}"
actions="{{ action2 }}" actions="{{ action2 }}"
cancel-text="取消"
bind:close="toggleActionSheet2" bind:close="toggleActionSheet2"
bind:cancel="toggleActionSheet2" bind:cancel="toggleActionSheet2"
bind:select="toggleActionSheet2" bind:select="toggleActionSheet2"
@ -21,7 +20,7 @@
</demo-block> </demo-block>
<demo-block title="展示取消按钮" padding> <demo-block title="展示取消按钮" padding>
<van-button bind:click="toggleActionSheet3">弹出菜单</van-button> <van-button type="primary" bind:click="toggleActionSheet3">弹出菜单</van-button>
<van-action-sheet <van-action-sheet
show="{{ show3 }}" show="{{ show3 }}"
actions="{{ action1 }}" actions="{{ action1 }}"
@ -32,7 +31,7 @@
</demo-block> </demo-block>
<demo-block title="展示标题栏" padding> <demo-block title="展示标题栏" padding>
<van-button bind:click="toggleActionSheet4">弹出菜单</van-button> <van-button type="primary" bind:click="toggleActionSheet4">弹出菜单</van-button>
<van-action-sheet <van-action-sheet
show="{{ show4 }}" show="{{ show4 }}"
title="标题" title="标题"

View File

@ -110,6 +110,7 @@ Page({
| title | 标题 | *string* | - | - | | title | 标题 | *string* | - | - |
| z-index | z-index 层级 | *number* | `100` | - | | z-index | z-index 层级 | *number* | `100` | - |
| cancel-text | 取消按钮文字 | *string* | - | - | | cancel-text | 取消按钮文字 | *string* | - | - |
| round | 是否显示圆角 | *boolean* | `true` | 1.0.0 |
| overlay | 是否显示遮罩层 | *boolean* | - | - | | overlay | 是否显示遮罩层 | *boolean* | - | - |
| close-on-click-overlay | 点击遮罩是否关闭菜单 | *boolean* | - | - | | close-on-click-overlay | 点击遮罩是否关闭菜单 | *boolean* | - | - |
| close-on-click-action | 是否在点击选项后关闭 | *boolean* | `true` | - | | close-on-click-action | 是否在点击选项后关闭 | *boolean* | `true` | - |

View File

@ -9,6 +9,10 @@ VantComponent({
show: Boolean, show: Boolean,
title: String, title: String,
cancelText: String, cancelText: String,
round: {
type: Boolean,
value: true
},
zIndex: { zIndex: {
type: Number, type: Number,
value: 100 value: 100

View File

@ -3,6 +3,7 @@
<van-popup <van-popup
show="{{ show }}" show="{{ show }}"
position="bottom" position="bottom"
round="{{ round }}"
z-index="{{ zIndex }}" z-index="{{ zIndex }}"
overlay="{{ overlay }}" overlay="{{ overlay }}"
custom-class="van-action-sheet" custom-class="van-action-sheet"