mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[breaking change] Actionsheet: rename to ActionSheet
This commit is contained in:
parent
fe89e18a24
commit
b8424f8de9
@ -34,7 +34,7 @@
|
||||
- Tabbar: add safe-area-inset-bottom prop [\#3149](https://github.com/youzan/vant/pull/3149)
|
||||
- SubmitBar: add safe-area-inset-bottom prop [\#3172](https://github.com/youzan/vant/pull/3172)
|
||||
- GoodsAction: add safe-area-inset-bottom prop [\#3174](https://github.com/youzan/vant/pull/3174)
|
||||
- Actionsheet: add safe-area-inset-bottom prop [\#3171](https://github.com/youzan/vant/pull/3171)
|
||||
- ActionSheet: add safe-area-inset-bottom prop [\#3171](https://github.com/youzan/vant/pull/3171)
|
||||
- NumberKeyboard: add safe-area-inset-bottom prop [\#3173](https://github.com/youzan/vant/pull/3173)
|
||||
|
||||
**Bug Fixes**
|
||||
@ -89,7 +89,7 @@
|
||||
|
||||
**Improvements**
|
||||
|
||||
- Actionsheet: add less vars [\#3049](https://github.com/youzan/vant/pull/3049)
|
||||
- ActionSheet: add less vars [\#3049](https://github.com/youzan/vant/pull/3049)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
@ -112,7 +112,7 @@
|
||||
- NoticeBar: add wrapable prop [\#2992](https://github.com/youzan/vant/pull/2992)
|
||||
- Field: add error-message-align prop [\#3016](https://github.com/youzan/vant/pull/3016)
|
||||
- Sku: support set selectedNum when inited [\#3045](https://github.com/youzan/vant/pull/3045)
|
||||
- Actionsheet: support use slot and cancel-text at same time [\#3021](https://github.com/youzan/vant/pull/3021)
|
||||
- ActionSheet: support use slot and cancel-text at same time [\#3021](https://github.com/youzan/vant/pull/3021)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
@ -152,7 +152,7 @@
|
||||
- CellGroup: add title prop [\#2928](https://github.com/youzan/vant/pull/2928)
|
||||
- Steps: add active-icon prop [\#2934](https://github.com/youzan/vant/pull/2934)
|
||||
- Picker: add default-index prop [\#2935](https://github.com/youzan/vant/pull/2935)
|
||||
- Actionsheet: add index param for select event [\#2917](https://github.com/youzan/vant/pull/2917)
|
||||
- ActionSheet: add index param for select event [\#2917](https://github.com/youzan/vant/pull/2917)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
@ -188,8 +188,8 @@
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- fix Actionsheet lazy-render not work [\#2840](https://github.com/youzan/vant/pull/2840)
|
||||
- fix Actionsheet get-container not work [\#2853](https://github.com/youzan/vant/pull/2853)
|
||||
- fix ActionSheet lazy-render not work [\#2840](https://github.com/youzan/vant/pull/2840)
|
||||
- fix ActionSheet get-container not work [\#2853](https://github.com/youzan/vant/pull/2853)
|
||||
- fix Tab should scroll to active tab when inited [\#2857](https://github.com/youzan/vant/pull/2857)
|
||||
- fix Checkbox uncheckable when inside cell [\#2855](https://github.com/youzan/vant/pull/2855)
|
||||
- fix CouponList incorrectly render when disabled list empty [\#2845](https://github.com/youzan/vant/pull/2845)
|
||||
@ -873,14 +873,14 @@ Also we have optimized the UI of the following components::
|
||||
|
||||
**Improvements**
|
||||
|
||||
- Actionsheet: add select event [\#1594](https://github.com/youzan/vant/pull/1594)
|
||||
- ActionSheet: add select event [\#1594](https://github.com/youzan/vant/pull/1594)
|
||||
- ImagePreview: suppot onClose callback [\#1589](https://github.com/youzan/vant/pull/1589)
|
||||
- List: add check method [\#1590](https://github.com/youzan/vant/pull/1590)
|
||||
- Search: update style [\#1603](https://github.com/youzan/vant/pull/1603)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- fix Actionsheet item unclickable when loading [\#1587](https://github.com/youzan/vant/pull/1587)
|
||||
- fix ActionSheet item unclickable when loading [\#1587](https://github.com/youzan/vant/pull/1587)
|
||||
- fix DatetimePicker value uncorrect when use formatter [\#1591](https://github.com/youzan/vant/pull/1591)
|
||||
|
||||
|
||||
@ -970,7 +970,7 @@ Also we have optimized the UI of the following components::
|
||||
|
||||
**Improvements**
|
||||
|
||||
- Actionsheet: support lazy render [\#1365](https://github.com/youzan/vant/pull/1365)
|
||||
- ActionSheet: support lazy render [\#1365](https://github.com/youzan/vant/pull/1365)
|
||||
- AddressEdit: adjust event order [\#1402](https://github.com/youzan/vant/pull/1402)
|
||||
- SwitchCell: add size prop [\#1371](https://github.com/youzan/vant/pull/1371)
|
||||
- Checkbox: add label-position prop [\#1394](https://github.com/youzan/vant/pull/1394)
|
||||
@ -1015,7 +1015,7 @@ Also we have optimized the UI of the following components::
|
||||
|
||||
**Improvements**
|
||||
|
||||
- Actionsheet: support disable option [\#1293](https://github.com/youzan/vant/pull/1293)
|
||||
- ActionSheet: support disable option [\#1293](https://github.com/youzan/vant/pull/1293)
|
||||
- Field: support clearable [\#1309](https://github.com/youzan/vant/pull/1309)
|
||||
- Layout: support flex layout [\#1305](https://github.com/youzan/vant/pull/1305)
|
||||
- Locale: add type definition [\#1294](https://github.com/youzan/vant/pull/1294)
|
||||
@ -1046,7 +1046,7 @@ Also we have optimized the UI of the following components::
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- fix Actionsheet title font size [\#1267](https://github.com/youzan/vant/pull/1267)
|
||||
- fix ActionSheet title font size [\#1267](https://github.com/youzan/vant/pull/1267)
|
||||
- fix CheckboxGroup v-model type check [\#1254](https://github.com/youzan/vant/pull/1254)
|
||||
- fix Popup max height [\#1256](https://github.com/youzan/vant/pull/1256)
|
||||
- fix Tab resize line when title changed [\#1260](https://github.com/youzan/vant/pull/1260)
|
||||
@ -1273,8 +1273,8 @@ Also we have optimized the UI of the following components::
|
||||
|
||||
**Improvements**
|
||||
|
||||
* Actionsheet: add cancel event [\#796](https://github.com/youzan/vant/pull/796)
|
||||
* Actionsheet: support maxHeight [\#777](https://github.com/youzan/vant/pull/777)
|
||||
* ActionSheet: add cancel event [\#796](https://github.com/youzan/vant/pull/796)
|
||||
* ActionSheet: support maxHeight [\#777](https://github.com/youzan/vant/pull/777)
|
||||
* DatetimePicker: support all picker props [\#788](https://github.com/youzan/vant/pull/788)
|
||||
* SubmitBar: unite font-size [\#774](https://github.com/youzan/vant/pull/774)
|
||||
* i18n: support zh-HK language [\#812](https://github.com/youzan/vant/pull/812)
|
||||
@ -1359,7 +1359,7 @@ Also we have optimized the UI of the following components::
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
* fix Actionsheet bottom border missing [\#686](https://github.com/youzan/vant/pull/686)
|
||||
* fix ActionSheet bottom border missing [\#686](https://github.com/youzan/vant/pull/686)
|
||||
* fix AddressEdit area not selected when area_code changed [\#680](https://github.com/youzan/vant/pull/680)
|
||||
* fix Stepper value overlimit [\#691](https://github.com/youzan/vant/issues/691)
|
||||
* fix Badge info font weight when selected [\#687](https://github.com/youzan/vant/pull/687)
|
||||
@ -1781,7 +1781,7 @@ Also we have optimized the UI of the following components::
|
||||
|
||||
**Improvements**
|
||||
|
||||
* Actionsheet: update close icon style [\#340](https://github.com/youzan/vant/pull/340)
|
||||
* ActionSheet: update close icon style [\#340](https://github.com/youzan/vant/pull/340)
|
||||
* Popup: add overlayClass and overlayStyle props [\#349](https://github.com/youzan/vant/pull/349) [\#343](https://github.com/youzan/vant/pull/343)
|
||||
* Icon: adjust unicode for better display [\#330](https://github.com/youzan/vant/pull/330)
|
||||
* ImagePreview: support manually close [\#346](https://github.com/youzan/vant/pull/346)
|
||||
|
@ -34,7 +34,7 @@
|
||||
- Tabbar: 新增 safe-area-inset-bottom 属性 [\#3149](https://github.com/youzan/vant/pull/3149)
|
||||
- SubmitBar: 新增 safe-area-inset-bottom 属性 [\#3172](https://github.com/youzan/vant/pull/3172)
|
||||
- GoodsAction: 新增 safe-area-inset-bottom 属性 [\#3174](https://github.com/youzan/vant/pull/3174)
|
||||
- Actionsheet: 新增 safe-area-inset-bottom 属性 [\#3171](https://github.com/youzan/vant/pull/3171)
|
||||
- ActionSheet: 新增 safe-area-inset-bottom 属性 [\#3171](https://github.com/youzan/vant/pull/3171)
|
||||
- NumberKeyboard: 新增 safe-area-inset-bottom 属性 [\#3173](https://github.com/youzan/vant/pull/3173)
|
||||
|
||||
**Bug Fixes**
|
||||
@ -89,7 +89,7 @@
|
||||
|
||||
**Improvements**
|
||||
|
||||
- Actionsheet: 新增 less 变量 [\#3049](https://github.com/youzan/vant/pull/3049)
|
||||
- ActionSheet: 新增 less 变量 [\#3049](https://github.com/youzan/vant/pull/3049)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
@ -112,7 +112,7 @@
|
||||
- NoticeBar: 新增 wrapable 属性 [\#2992](https://github.com/youzan/vant/pull/2992)
|
||||
- Field: 新增 error-message-align 属性 [\#3016](https://github.com/youzan/vant/pull/3016)
|
||||
- Sku: 支持在初始化时设置选中商品数量 [\#3045](https://github.com/youzan/vant/pull/3045)
|
||||
- Actionsheet: 支持同时设置默认插槽和 cancel-text [\#3021](https://github.com/youzan/vant/pull/3021)
|
||||
- ActionSheet: 支持同时设置默认插槽和 cancel-text [\#3021](https://github.com/youzan/vant/pull/3021)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
@ -152,7 +152,7 @@
|
||||
- CellGroup: 新增 title 属性 [\#2928](https://github.com/youzan/vant/pull/2928)
|
||||
- Steps: 新增 active-icon 属性 [\#2934](https://github.com/youzan/vant/pull/2934)
|
||||
- Picker: 新增 default-index 属性 [\#2935](https://github.com/youzan/vant/pull/2935)
|
||||
- Actionsheet: 新增 index 作为 select 事件的回调参数 [\#2917](https://github.com/youzan/vant/pull/2917)
|
||||
- ActionSheet: 新增 index 作为 select 事件的回调参数 [\#2917](https://github.com/youzan/vant/pull/2917)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
@ -188,8 +188,8 @@
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- 修复 Actionsheet lazy-render 属性不生效的问题 [\#2840](https://github.com/youzan/vant/pull/2840)
|
||||
- 修复 Actionsheet get-container 属性不生效的问题 [\#2853](https://github.com/youzan/vant/pull/2853)
|
||||
- 修复 ActionSheet lazy-render 属性不生效的问题 [\#2840](https://github.com/youzan/vant/pull/2840)
|
||||
- 修复 ActionSheet get-container 属性不生效的问题 [\#2853](https://github.com/youzan/vant/pull/2853)
|
||||
- 修复 Tab 初始化时导航栏未自动滚动到当前标签位置的问题 [\#2857](https://github.com/youzan/vant/pull/2857)
|
||||
- 修复 Checkbox 与 Cell 组件嵌套用法在 Vue 2.6+ 上的兼容问题 [\#2855](https://github.com/youzan/vant/pull/2855)
|
||||
- 修复 CouponList 不可用券列表为空时展示错误的问题 [\#2845](https://github.com/youzan/vant/pull/2845)
|
||||
@ -875,14 +875,14 @@ PS: 不小心跳过了 1.4.6 版本 ^_^
|
||||
|
||||
**Improvements**
|
||||
|
||||
- Actionsheet: 新增 select 事件 [\#1594](https://github.com/youzan/vant/pull/1594)
|
||||
- ActionSheet: 新增 select 事件 [\#1594](https://github.com/youzan/vant/pull/1594)
|
||||
- ImagePreview: 支持传入 onClose 回调函数 [\#1589](https://github.com/youzan/vant/pull/1589)
|
||||
- List: 新增 check 方法 [\#1590](https://github.com/youzan/vant/pull/1590)
|
||||
- Search: 优化样式结构 [\#1603](https://github.com/youzan/vant/pull/1603)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- 修复 Actionsheet 选项加载中时仍然有点击态的问题 [\#1587](https://github.com/youzan/vant/pull/1587)
|
||||
- 修复 ActionSheet 选项加载中时仍然有点击态的问题 [\#1587](https://github.com/youzan/vant/pull/1587)
|
||||
- 修复 DatetimePicker 使用 formatter 时默认值错误的问题 [\#1591](https://github.com/youzan/vant/pull/1591)
|
||||
|
||||
|
||||
@ -970,7 +970,7 @@ PS: 不小心跳过了 1.4.6 版本 ^_^
|
||||
|
||||
**Improvements**
|
||||
|
||||
- Actionsheet: 支持 lazy-render [\#1365](https://github.com/youzan/vant/pull/1365)
|
||||
- ActionSheet: 支持 lazy-render [\#1365](https://github.com/youzan/vant/pull/1365)
|
||||
- AddressEdit: 优化事件触发顺序 [\#1402](https://github.com/youzan/vant/pull/1402)
|
||||
- SwitchCell: 新增 size 属性 [\#1371](https://github.com/youzan/vant/pull/1371)
|
||||
- Checkbox: 新增 label-position 属性 [\#1394](https://github.com/youzan/vant/pull/1394)
|
||||
@ -1015,7 +1015,7 @@ PS: 不小心跳过了 1.4.6 版本 ^_^
|
||||
|
||||
**Improvements**
|
||||
|
||||
- Actionsheet: 支持禁用选项 [\#1293](https://github.com/youzan/vant/pull/1293)
|
||||
- ActionSheet: 支持禁用选项 [\#1293](https://github.com/youzan/vant/pull/1293)
|
||||
- Field: 支持展示清除控件 [\#1309](https://github.com/youzan/vant/pull/1309)
|
||||
- Layout: 支持 Flex 布局 [\#1305](https://github.com/youzan/vant/pull/1305)
|
||||
- Locale: 新增 TS 类型定义 [\#1294](https://github.com/youzan/vant/pull/1294)
|
||||
@ -1046,7 +1046,7 @@ PS: 不小心跳过了 1.4.6 版本 ^_^
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- 修复 Actionsheet 在 rem 布局下标题文字大小错误的问题 [\#1267](https://github.com/youzan/vant/pull/1267)
|
||||
- 修复 ActionSheet 在 rem 布局下标题文字大小错误的问题 [\#1267](https://github.com/youzan/vant/pull/1267)
|
||||
- 修复 CheckboxGroup v-model 类型检查错误 [\#1254](https://github.com/youzan/vant/pull/1254)
|
||||
- 修复 Tab 标题长度变化时底部条未重新渲染的问题 [\#1260](https://github.com/youzan/vant/pull/1260)
|
||||
- 修复 Popup 内容过高时超出屏幕可视范围的问题 [\#1256](https://github.com/youzan/vant/pull/1256)
|
||||
@ -1269,8 +1269,8 @@ PS: 不小心跳过了 1.4.6 版本 ^_^
|
||||
|
||||
**Improvements**
|
||||
|
||||
- Actionsheet: 新增 cancel 事件 [\#796](https://github.com/youzan/vant/pull/796)
|
||||
- Actionsheet: 增加最大高度限制 [\#777](https://github.com/youzan/vant/pull/777)
|
||||
- ActionSheet: 新增 cancel 事件 [\#796](https://github.com/youzan/vant/pull/796)
|
||||
- ActionSheet: 增加最大高度限制 [\#777](https://github.com/youzan/vant/pull/777)
|
||||
- DatetimePicker: 支持所有 picker 组件配置 [\#788](https://github.com/youzan/vant/pull/788)
|
||||
- SubmitBar: 统一文字大小 [\#774](https://github.com/youzan/vant/pull/774)
|
||||
- i18n: 支持 zh-HK 语言 [\#812](https://github.com/youzan/vant/pull/812)
|
||||
@ -1353,7 +1353,7 @@ PS: 不小心跳过了 1.4.6 版本 ^_^
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
* 修复 Actionsheet 下边框未展示的问题 [\#686](https://github.com/youzan/vant/pull/686)
|
||||
* 修复 ActionSheet 下边框未展示的问题 [\#686](https://github.com/youzan/vant/pull/686)
|
||||
* 修复 AddressEdit 在数据变更时未正确选中省市区的问题 [\#680](https://github.com/youzan/vant/pull/680)
|
||||
* 修复 Stepper value 溢出的问题 [\#691](https://github.com/youzan/vant/issues/691)
|
||||
* 修复 Badge 选中时字体粗细 [\#687](https://github.com/youzan/vant/pull/687)
|
||||
@ -1774,7 +1774,7 @@ PS: 不小心跳过了 1.4.6 版本 ^_^
|
||||
|
||||
**Improvements**
|
||||
|
||||
* Actionsheet: 更新关闭按钮样式 [\#340](https://github.com/youzan/vant/pull/340)
|
||||
* ActionSheet: 更新关闭按钮样式 [\#340](https://github.com/youzan/vant/pull/340)
|
||||
* Popup: 新增 overlayClass、overlayStyle 属性 [\#349](https://github.com/youzan/vant/pull/349) [\#343](https://github.com/youzan/vant/pull/343)
|
||||
* Icon: 调整 unicode,避免展示特殊字符 [\#330](https://github.com/youzan/vant/pull/330)
|
||||
* ImagePreview: 支持手动关闭 [\#346](https://github.com/youzan/vant/pull/346)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
### Actionsheet
|
||||
|
||||
- [ ] 重命名为 ActionSheet
|
||||
- [x] 重命名为 ActionSheet
|
||||
|
||||
### Button
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
import { wrapper } from './demo-common';
|
||||
|
||||
export default {
|
||||
'actionsheet': () => wrapper(import('../../packages/actionsheet/demo'), 'actionsheet'),
|
||||
'action-sheet': () => wrapper(import('../../packages/action-sheet/demo'), 'action-sheet'),
|
||||
'address-edit': () => wrapper(import('../../packages/address-edit/demo'), 'address-edit'),
|
||||
'address-list': () => wrapper(import('../../packages/address-list/demo'), 'address-list'),
|
||||
'area': () => wrapper(import('../../packages/area/demo'), 'area'),
|
||||
|
@ -168,8 +168,8 @@ module.exports = {
|
||||
icon: 'passed',
|
||||
list: [
|
||||
{
|
||||
path: '/actionsheet',
|
||||
title: 'Actionsheet 上拉菜单'
|
||||
path: '/action-sheet',
|
||||
title: 'ActionSheet 上拉菜单'
|
||||
},
|
||||
{
|
||||
path: '/dialog',
|
||||
@ -475,8 +475,8 @@ module.exports = {
|
||||
icon: 'passed',
|
||||
list: [
|
||||
{
|
||||
path: '/actionsheet',
|
||||
title: 'Actionsheet'
|
||||
path: '/action-sheet',
|
||||
title: 'ActionSheet'
|
||||
},
|
||||
{
|
||||
path: '/dialog',
|
||||
|
@ -12,8 +12,8 @@ export default {
|
||||
'style-guide.zh-CN': () => import('../markdown/style-guide.zh-CN.md'),
|
||||
'theme.en-US': () => import('../markdown/theme.en-US.md'),
|
||||
'theme.zh-CN': () => import('../markdown/theme.zh-CN.md'),
|
||||
'actionsheet.en-US': () => import('../../packages/actionsheet/en-US.md'),
|
||||
'actionsheet.zh-CN': () => import('../../packages/actionsheet/zh-CN.md'),
|
||||
'action-sheet.en-US': () => import('../../packages/action-sheet/en-US.md'),
|
||||
'action-sheet.zh-CN': () => import('../../packages/action-sheet/zh-CN.md'),
|
||||
'address-edit.en-US': () => import('../../packages/address-edit/en-US.md'),
|
||||
'address-edit.zh-CN': () => import('../../packages/address-edit/zh-CN.md'),
|
||||
'address-list.en-US': () => import('../../packages/address-list/en-US.md'),
|
||||
|
@ -2,7 +2,7 @@
|
||||
<demo-section>
|
||||
<demo-block :title="$t('basicUsage')">
|
||||
<van-button @click="show1 = true">{{ $t('button1') }}</van-button>
|
||||
<van-actionsheet
|
||||
<van-action-sheet
|
||||
v-model="show1"
|
||||
:actions="actions"
|
||||
@select="onSelect"
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
<demo-block :title="$t('title2')">
|
||||
<van-button @click="show2 = true">{{ $t('button2') }}</van-button>
|
||||
<van-actionsheet
|
||||
<van-action-sheet
|
||||
v-model="show2"
|
||||
:actions="actions"
|
||||
:cancel-text="$t('cancel')"
|
||||
@ -22,12 +22,12 @@
|
||||
|
||||
<demo-block :title="$t('title3')">
|
||||
<van-button @click="show3 = true">{{ $t('button3') }}</van-button>
|
||||
<van-actionsheet
|
||||
<van-action-sheet
|
||||
v-model="show3"
|
||||
:title="$t('title')"
|
||||
>
|
||||
<p>{{ $t('content') }}</p>
|
||||
</van-actionsheet>
|
||||
</van-action-sheet>
|
||||
</demo-block>
|
||||
</demo-section>
|
||||
</template>
|
||||
@ -36,20 +36,20 @@
|
||||
export default {
|
||||
i18n: {
|
||||
'zh-CN': {
|
||||
button1: '弹出 Actionsheet',
|
||||
button2: '弹出带取消按钮的 Actionsheet',
|
||||
button3: '弹出带标题的 Actionsheet',
|
||||
title2: '带取消按钮的 Actionsheet',
|
||||
title3: '带标题的 Actionsheet',
|
||||
button1: '弹出 ActionSheet',
|
||||
button2: '弹出带取消按钮的 ActionSheet',
|
||||
button3: '弹出带标题的 ActionSheet',
|
||||
title2: '带取消按钮的 ActionSheet',
|
||||
title3: '带标题的 ActionSheet',
|
||||
description: '描述信息',
|
||||
disabledOption: '禁用选项'
|
||||
},
|
||||
'en-US': {
|
||||
button1: 'Show Actionsheet',
|
||||
button2: 'Show Actionsheet with cancel button',
|
||||
button3: 'Show Actionsheet with title',
|
||||
title2: 'Actionsheet with cancel button',
|
||||
title3: 'Actionsheet with title',
|
||||
button1: 'Show ActionSheet',
|
||||
button2: 'Show ActionSheet with cancel button',
|
||||
button3: 'Show ActionSheet with title',
|
||||
title2: 'ActionSheet with cancel button',
|
||||
title3: 'ActionSheet with title',
|
||||
description: 'Description',
|
||||
disabledOption: 'Disabled Option'
|
||||
}
|
||||
@ -89,7 +89,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.demo-actionsheet {
|
||||
.demo-action-sheet {
|
||||
.van-button {
|
||||
margin-left: 15px;
|
||||
}
|
@ -1,19 +1,19 @@
|
||||
## Actionsheet
|
||||
## ActionSheet
|
||||
|
||||
### Install
|
||||
``` javascript
|
||||
import { Actionsheet } from 'vant';
|
||||
import { ActionSheet } from 'vant';
|
||||
|
||||
Vue.use(Actionsheet);
|
||||
Vue.use(ActionSheet);
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
#### Basic Usage
|
||||
Use `actions` prop to set options of actionsheet.
|
||||
Use `actions` prop to set options of action-sheet.
|
||||
|
||||
```html
|
||||
<van-actionsheet
|
||||
<van-action-sheet
|
||||
v-model="show"
|
||||
:actions="actions"
|
||||
@select="onSelect"
|
||||
@ -53,10 +53,10 @@ export default {
|
||||
}
|
||||
```
|
||||
|
||||
#### Actionsheet with cancel button
|
||||
#### ActionSheet with cancel button
|
||||
|
||||
```html
|
||||
<van-actionsheet
|
||||
<van-action-sheet
|
||||
v-model="show"
|
||||
:actions="actions"
|
||||
cancel-text="Cancel"
|
||||
@ -65,13 +65,13 @@ export default {
|
||||
/>
|
||||
```
|
||||
|
||||
#### Actionsheet with title
|
||||
Actionsheet will get another style if there is a `title` prop.
|
||||
#### ActionSheet with title
|
||||
ActionSheet will get another style if there is a `title` prop.
|
||||
|
||||
```html
|
||||
<van-actionsheet v-model="show" title="Title">
|
||||
<van-action-sheet v-model="show" title="Title">
|
||||
<p>Content</p>
|
||||
</van-actionsheet>
|
||||
</van-action-sheet>
|
||||
```
|
||||
|
||||
### API
|
||||
@ -84,7 +84,7 @@ Actionsheet will get another style if there is a `title` prop.
|
||||
| overlay | Whether to show 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` |
|
||||
| get-container | Return the mount node for actionsheet | `String | () => HTMLElement` | - |
|
||||
| get-container | Return the mount node for action-sheet | `String | () => HTMLElement` | - |
|
||||
| safe-area-inset-bottom | Whether to enable bottom safe area adaptation, to enable those features use `viewport-fit=cover` in the `viewport` meta tag | `Boolean` | `false` |
|
||||
|
||||
### Event
|
@ -1,6 +1,6 @@
|
||||
@import '../style/var';
|
||||
|
||||
.van-actionsheet {
|
||||
.van-action-sheet {
|
||||
color: @action-sheet-item-text-color;
|
||||
max-height: @action-sheet-max-height;
|
||||
|
@ -10,29 +10,29 @@ import { CreateElement, RenderContext } from 'vue/types';
|
||||
import { DefaultSlots } from '../utils/use/sfc';
|
||||
import { PopupMixinProps } from '../mixins/popup/type';
|
||||
|
||||
export type ActionsheetItem = {
|
||||
export type ActionSheetItem = {
|
||||
name: string;
|
||||
subname?: string;
|
||||
loading?: boolean;
|
||||
disabled?: boolean;
|
||||
className?: string;
|
||||
callback?: (item: ActionsheetItem) => void;
|
||||
callback?: (item: ActionSheetItem) => void;
|
||||
};
|
||||
|
||||
export type ActionsheetProps = PopupMixinProps & {
|
||||
export type ActionSheetProps = PopupMixinProps & {
|
||||
title?: string;
|
||||
actions: ActionsheetItem[];
|
||||
actions: ActionSheetItem[];
|
||||
cancelText?: string;
|
||||
safeAreaInsetBottom?: boolean;
|
||||
};
|
||||
|
||||
const [sfc, bem] = use('actionsheet');
|
||||
const [sfc, bem] = use('action-sheet');
|
||||
|
||||
function Actionsheet(
|
||||
function ActionSheet(
|
||||
h: CreateElement,
|
||||
props: ActionsheetProps,
|
||||
props: ActionSheetProps,
|
||||
slots: DefaultSlots,
|
||||
ctx: RenderContext<ActionsheetProps>
|
||||
ctx: RenderContext<ActionSheetProps>
|
||||
) {
|
||||
const { title, cancelText } = props;
|
||||
|
||||
@ -48,7 +48,7 @@ function Actionsheet(
|
||||
</div>
|
||||
);
|
||||
|
||||
const Option = (item: ActionsheetItem, index: number) => (
|
||||
const Option = (item: ActionSheetItem, index: number) => (
|
||||
<div
|
||||
class={[
|
||||
bem('item', { disabled: item.disabled || item.loading }),
|
||||
@ -103,7 +103,7 @@ function Actionsheet(
|
||||
);
|
||||
}
|
||||
|
||||
Actionsheet.props = {
|
||||
ActionSheet.props = {
|
||||
...PopupMixin.props,
|
||||
title: String,
|
||||
actions: Array,
|
||||
@ -119,4 +119,4 @@ Actionsheet.props = {
|
||||
}
|
||||
};
|
||||
|
||||
export default sfc<ActionsheetProps>(Actionsheet);
|
||||
export default sfc<ActionSheetProps>(ActionSheet);
|
@ -2,13 +2,13 @@
|
||||
|
||||
exports[`renders demo correctly 1`] = `
|
||||
<div>
|
||||
<div><button class="van-button van-button--default van-button--normal"><span class="van-button__text">弹出 Actionsheet</span></button>
|
||||
<div><button class="van-button van-button--default van-button--normal"><span class="van-button__text">弹出 ActionSheet</span></button>
|
||||
<!---->
|
||||
</div>
|
||||
<div><button class="van-button van-button--default van-button--normal"><span class="van-button__text">弹出带取消按钮的 Actionsheet</span></button>
|
||||
<div><button class="van-button van-button--default van-button--normal"><span class="van-button__text">弹出带取消按钮的 ActionSheet</span></button>
|
||||
<!---->
|
||||
</div>
|
||||
<div><button class="van-button van-button--default van-button--normal"><span class="van-button__text">弹出带标题的 Actionsheet</span></button>
|
||||
<div><button class="van-button van-button--default van-button--normal"><span class="van-button__text">弹出带标题的 ActionSheet</span></button>
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
17
packages/action-sheet/test/__snapshots__/index.spec.js.snap
Normal file
17
packages/action-sheet/test/__snapshots__/index.spec.js.snap
Normal file
@ -0,0 +1,17 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`callback events 1`] = `
|
||||
<div class="van-popup van-popup--bottom van-action-sheet" name="van-popup-slide-bottom">
|
||||
<div class="van-action-sheet__item van-hairline--top"><span class="van-action-sheet__name">Option</span></div>
|
||||
<div class="van-action-sheet__item van-action-sheet__item--disabled van-hairline--top"><span class="van-action-sheet__name">Option</span></div>
|
||||
<div class="van-action-sheet__cancel">Cancel</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`disable lazy-render 1`] = `
|
||||
<div class="van-popup van-popup--bottom van-action-sheet" style="display: none;" name="van-popup-slide-bottom">
|
||||
<div class="van-action-sheet__item van-hairline--top"><span class="van-action-sheet__name">Option</span></div>
|
||||
<div class="van-action-sheet__item van-hairline--top"><span class="van-action-sheet__name">Option</span></div>
|
||||
<div class="van-action-sheet__cancel">Cancel</div>
|
||||
</div>
|
||||
`;
|
@ -1,5 +1,5 @@
|
||||
import { mount } from '../../../test/utils';
|
||||
import Actionsheet from '..';
|
||||
import ActionSheet from '..';
|
||||
|
||||
test('callback events', () => {
|
||||
const callback = jest.fn();
|
||||
@ -12,7 +12,7 @@ test('callback events', () => {
|
||||
{ name: 'Option', disabled: true }
|
||||
];
|
||||
|
||||
const wrapper = mount(Actionsheet, {
|
||||
const wrapper = mount(ActionSheet, {
|
||||
propsData: {
|
||||
value: true,
|
||||
actions,
|
||||
@ -27,10 +27,10 @@ test('callback events', () => {
|
||||
}
|
||||
});
|
||||
|
||||
const options = wrapper.findAll('.van-actionsheet__item');
|
||||
const options = wrapper.findAll('.van-action-sheet__item');
|
||||
options.at(0).trigger('click');
|
||||
options.at(1).trigger('click');
|
||||
wrapper.find('.van-actionsheet__cancel').trigger('click');
|
||||
wrapper.find('.van-action-sheet__cancel').trigger('click');
|
||||
|
||||
expect(callback).toHaveBeenCalled();
|
||||
expect(onCancel).toHaveBeenCalled();
|
||||
@ -40,7 +40,7 @@ test('callback events', () => {
|
||||
});
|
||||
|
||||
test('disable lazy-render', () => {
|
||||
const wrapper = mount(Actionsheet, {
|
||||
const wrapper = mount(ActionSheet, {
|
||||
propsData: {
|
||||
lazyRender: false,
|
||||
actions: [
|
||||
@ -55,7 +55,7 @@ test('disable lazy-render', () => {
|
||||
});
|
||||
|
||||
test('get container', () => {
|
||||
const wrapper = mount(Actionsheet, {
|
||||
const wrapper = mount(ActionSheet, {
|
||||
propsData: {
|
||||
value: true,
|
||||
getContainer: 'body'
|
@ -1,10 +1,10 @@
|
||||
## Actionsheet 上拉菜单
|
||||
## ActionSheet 上拉菜单
|
||||
|
||||
### 使用指南
|
||||
``` javascript
|
||||
import { Actionsheet } from 'vant';
|
||||
import { ActionSheet } from 'vant';
|
||||
|
||||
Vue.use(Actionsheet);
|
||||
Vue.use(ActionSheet);
|
||||
```
|
||||
|
||||
### 代码演示
|
||||
@ -14,7 +14,7 @@ Vue.use(Actionsheet);
|
||||
需要传入一个`actions`的数组,数组的每一项是一个对象,对象属性见文档下方表格。
|
||||
|
||||
```html
|
||||
<van-actionsheet
|
||||
<van-action-sheet
|
||||
v-model="show"
|
||||
:actions="actions"
|
||||
@select="onSelect"
|
||||
@ -55,12 +55,12 @@ export default {
|
||||
}
|
||||
```
|
||||
|
||||
#### 带取消按钮的 Actionsheet
|
||||
#### 带取消按钮的 ActionSheet
|
||||
|
||||
如果传入了`cancelText`属性,且不为空,则会在下方显示一个取消按钮,点击会将当前`Actionsheet`关闭。
|
||||
如果传入了`cancelText`属性,且不为空,则会在下方显示一个取消按钮,点击会将当前`ActionSheet`关闭。
|
||||
|
||||
```html
|
||||
<van-actionsheet
|
||||
<van-action-sheet
|
||||
v-model="show"
|
||||
:actions="actions"
|
||||
cancel-text="取消"
|
||||
@ -69,14 +69,14 @@ export default {
|
||||
/>
|
||||
```
|
||||
|
||||
#### 带标题的 Actionsheet
|
||||
#### 带标题的 ActionSheet
|
||||
|
||||
如果传入了`title`属性,且不为空,则另外一种样式的`Actionsheet`,里面内容需要自定义。
|
||||
如果传入了`title`属性,且不为空,则另外一种样式的`ActionSheet`,里面内容需要自定义。
|
||||
|
||||
```html
|
||||
<van-actionsheet v-model="show" title="支持以下配送方式">
|
||||
<van-action-sheet v-model="show" title="支持以下配送方式">
|
||||
<p>一些内容</p>
|
||||
</van-actionsheet>
|
||||
</van-action-sheet>
|
||||
```
|
||||
|
||||
### API
|
@ -1,17 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`callback events 1`] = `
|
||||
<div class="van-popup van-popup--bottom van-actionsheet" name="van-popup-slide-bottom">
|
||||
<div class="van-actionsheet__item van-hairline--top"><span class="van-actionsheet__name">Option</span></div>
|
||||
<div class="van-actionsheet__item van-actionsheet__item--disabled van-hairline--top"><span class="van-actionsheet__name">Option</span></div>
|
||||
<div class="van-actionsheet__cancel">Cancel</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`disable lazy-render 1`] = `
|
||||
<div class="van-popup van-popup--bottom van-actionsheet" style="display: none;" name="van-popup-slide-bottom">
|
||||
<div class="van-actionsheet__item van-hairline--top"><span class="van-actionsheet__name">Option</span></div>
|
||||
<div class="van-actionsheet__item van-hairline--top"><span class="van-actionsheet__name">Option</span></div>
|
||||
<div class="van-actionsheet__cancel">Cancel</div>
|
||||
</div>
|
||||
`;
|
@ -44,7 +44,7 @@
|
||||
@import './number-keyboard/index';
|
||||
|
||||
/* action components */
|
||||
@import './actionsheet/index';
|
||||
@import './action-sheet/index';
|
||||
@import './dialog/index';
|
||||
@import './picker/index';
|
||||
@import './pull-refresh/index';
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* eslint-disable */
|
||||
// This file is auto gererated by build/build-entry.js
|
||||
import { VueConstructor } from 'vue/types';
|
||||
import Actionsheet from './actionsheet';
|
||||
import ActionSheet from './action-sheet';
|
||||
import AddressEdit from './address-edit';
|
||||
import AddressList from './address-list';
|
||||
import Area from './area';
|
||||
@ -82,7 +82,7 @@ declare global {
|
||||
|
||||
const version = '1.6.16';
|
||||
const components = [
|
||||
Actionsheet,
|
||||
ActionSheet,
|
||||
AddressEdit,
|
||||
AddressList,
|
||||
Area,
|
||||
@ -167,7 +167,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
||||
export {
|
||||
install,
|
||||
version,
|
||||
Actionsheet,
|
||||
ActionSheet,
|
||||
AddressEdit,
|
||||
AddressList,
|
||||
Area,
|
||||
|
2
types/index.d.ts
vendored
2
types/index.d.ts
vendored
@ -10,7 +10,7 @@ import { ImagePreview } from './image-preview';
|
||||
|
||||
export const version: string;
|
||||
export function install (vue: typeof Vue): void
|
||||
export class Actionsheet extends VanComponent {}
|
||||
export class ActionSheet extends VanComponent {}
|
||||
export class AddressEdit extends VanComponent {}
|
||||
export class AddressList extends VanComponent {}
|
||||
export class Area extends VanComponent {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user