[breaking change] CellSwipe: rename to SwipeCell (#1652)

This commit is contained in:
neverland 2018-08-20 10:15:30 +08:00 committed by GitHub
parent 7f00320e1f
commit e6cc4eab03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 116 additions and 116 deletions

View File

@ -22,7 +22,7 @@
**Improvements** **Improvements**
- Button: add warning type [\#1558](https://github.com/youzan/vant/pull/1558) - Button: add warning type [\#1558](https://github.com/youzan/vant/pull/1558)
- CellSwipe: add open method [\#1546](https://github.com/youzan/vant/pull/1546) - SwipeCell: add open method [\#1546](https://github.com/youzan/vant/pull/1546)
- DatetimePicker: support minute range [\#1583](https://github.com/youzan/vant/pull/1583) - DatetimePicker: support minute range [\#1583](https://github.com/youzan/vant/pull/1583)
- Icon: add size prop [\#1555](https://github.com/youzan/vant/pull/1555) - Icon: add size prop [\#1555](https://github.com/youzan/vant/pull/1555)
- Stepper: update disabled color [\#1560](https://github.com/youzan/vant/pull/1560) - Stepper: update disabled color [\#1560](https://github.com/youzan/vant/pull/1560)
@ -393,7 +393,7 @@
* fix NavBar title max width limitation [\#867](https://github.com/youzan/vant/pull/867) * fix NavBar title max width limitation [\#867](https://github.com/youzan/vant/pull/867)
* fix Button vertical align incorrect when loading [\#858](https://github.com/youzan/vant/pull/858) * fix Button vertical align incorrect when loading [\#858](https://github.com/youzan/vant/pull/858)
* fix CellSwipe should only trigger swipe when drag horizontally [\#866](https://github.com/youzan/vant/pull/866) * fix SwipeCell should only trigger swipe when drag horizontally [\#866](https://github.com/youzan/vant/pull/866)
* fix ImagePreview manually close not work [\#864](https://github.com/youzan/vant/pull/864) * fix ImagePreview manually close not work [\#864](https://github.com/youzan/vant/pull/864)
* fix SubmitBar inherit wrong font size [\#857](https://github.com/youzan/vant/pull/857) * fix SubmitBar inherit wrong font size [\#857](https://github.com/youzan/vant/pull/857)
* fix SwitchCell text vertical align [\#852](https://github.com/youzan/vant/pull/852) * fix SwitchCell text vertical align [\#852](https://github.com/youzan/vant/pull/852)
@ -477,7 +477,7 @@
**Improvements** **Improvements**
* AddressEdit: add show-delete prop [\#716](https://github.com/youzan/vant/pull/716) * AddressEdit: add show-delete prop [\#716](https://github.com/youzan/vant/pull/716)
* CellSwipe: optimzie animation fluency [\#685](https://github.com/youzan/vant/pull/685) * SwipeCell: optimzie animation fluency [\#685](https://github.com/youzan/vant/pull/685)
* Field: support autosize maxHeight & minHeight [\#718](https://github.com/youzan/vant/pull/718) * Field: support autosize maxHeight & minHeight [\#718](https://github.com/youzan/vant/pull/718)
* Locale: optimize i18n config [\#701](https://github.com/youzan/vant/pull/701) * Locale: optimize i18n config [\#701](https://github.com/youzan/vant/pull/701)
* PullRefresh: support trigger loading animation [\#684](https://github.com/youzan/vant/pull/684) * PullRefresh: support trigger loading animation [\#684](https://github.com/youzan/vant/pull/684)
@ -895,7 +895,7 @@
**Improvements** **Improvements**
* CellSwipe: add onClose prop, support async controll [\#356](https://github.com/youzan/vant/pull/356) * SwipeCell: add onClose prop, support async controll [\#356](https://github.com/youzan/vant/pull/356)
* Uploader: support inherit attrs [\#357](https://github.com/youzan/vant/pull/357) * Uploader: support inherit attrs [\#357](https://github.com/youzan/vant/pull/357)
* optimize local compile speed [\#355](https://github.com/youzan/vant/pull/355) * optimize local compile speed [\#355](https://github.com/youzan/vant/pull/355)

View File

@ -5,7 +5,7 @@
**Breaking changes** **Breaking changes**
- CellSwipe 滑动单元格 可以实现点击一个按钮,多个cellswip向右滑动吗? [\#1538](https://github.com/youzan/vant/issues/1538) - SwipeCell 滑动单元格 可以实现点击一个按钮,多个cellswip向右滑动吗? [\#1538](https://github.com/youzan/vant/issues/1538)
- 日期控件datetimepicker可以对时分设置范围 [\#1531](https://github.com/youzan/vant/issues/1531) - 日期控件datetimepicker可以对时分设置范围 [\#1531](https://github.com/youzan/vant/issues/1531)
- Tab 组件 sticky 增加一个 距离顶部的高度功能 [\#1504](https://github.com/youzan/vant/issues/1504) - Tab 组件 sticky 增加一个 距离顶部的高度功能 [\#1504](https://github.com/youzan/vant/issues/1504)
@ -28,7 +28,7 @@
- stepper 步进器 点击加号 减号也有点击反馈 [\#1599](https://github.com/youzan/vant/issues/1599) - stepper 步进器 点击加号 减号也有点击反馈 [\#1599](https://github.com/youzan/vant/issues/1599)
- upload到底怎么使用啊,怎么把得到的参数替换掉默认图片的路径呢? [\#1596](https://github.com/youzan/vant/issues/1596) - upload到底怎么使用啊,怎么把得到的参数替换掉默认图片的路径呢? [\#1596](https://github.com/youzan/vant/issues/1596)
- ImagePreview最新版本预览图片报错 [\#1595](https://github.com/youzan/vant/issues/1595) - ImagePreview最新版本预览图片报错 [\#1595](https://github.com/youzan/vant/issues/1595)
- CellSwipe 左滑right 有 edit delete 两个按钮的时候,如何判断点击的是哪个呢? [\#1593](https://github.com/youzan/vant/issues/1593) - SwipeCell 左滑right 有 edit delete 两个按钮的时候,如何判断点击的是哪个呢? [\#1593](https://github.com/youzan/vant/issues/1593)
- 商品规格弹层控件中如果设置none\_sku: true,加入购物车时还提示“选择规格” [\#1588](https://github.com/youzan/vant/issues/1588) - 商品规格弹层控件中如果设置none\_sku: true,加入购物车时还提示“选择规格” [\#1588](https://github.com/youzan/vant/issues/1588)
- Low android version compatibility issues [\#1585](https://github.com/youzan/vant/issues/1585) - Low android version compatibility issues [\#1585](https://github.com/youzan/vant/issues/1585)
- vant collapse使用报错 [\#1584](https://github.com/youzan/vant/issues/1584) - vant collapse使用报错 [\#1584](https://github.com/youzan/vant/issues/1584)
@ -80,7 +80,7 @@
- npm install 下来的css里边有的icon font文件是cdn引用的而不是本地的。 [\#1552](https://github.com/youzan/vant/issues/1552) - npm install 下来的css里边有的icon font文件是cdn引用的而不是本地的。 [\#1552](https://github.com/youzan/vant/issues/1552)
- DatetimePicker 中能否加上年月日上午/下午 [\#1551](https://github.com/youzan/vant/issues/1551) - DatetimePicker 中能否加上年月日上午/下午 [\#1551](https://github.com/youzan/vant/issues/1551)
- 手机滚动不流畅啊没有个scroll-content? [\#1549](https://github.com/youzan/vant/issues/1549) - 手机滚动不流畅啊没有个scroll-content? [\#1549](https://github.com/youzan/vant/issues/1549)
- CellSwipe 滑动单元格如何确定当前数据条目? [\#1548](https://github.com/youzan/vant/issues/1548) - SwipeCell 滑动单元格如何确定当前数据条目? [\#1548](https://github.com/youzan/vant/issues/1548)
- 怎么修改弹出层样式 [\#1547](https://github.com/youzan/vant/issues/1547) - 怎么修改弹出层样式 [\#1547](https://github.com/youzan/vant/issues/1547)
- popup 组件中 lock-scroll 功能 在 ios 中失效 [\#1544](https://github.com/youzan/vant/issues/1544) - popup 组件中 lock-scroll 功能 在 ios 中失效 [\#1544](https://github.com/youzan/vant/issues/1544)
- 以$toast、$dialog 形式调用 toast和dialog在prod环境莫名undefined [\#1542](https://github.com/youzan/vant/issues/1542) - 以$toast、$dialog 形式调用 toast和dialog在prod环境莫名undefined [\#1542](https://github.com/youzan/vant/issues/1542)
@ -119,7 +119,7 @@
- \[Improvement\] Button: add warning type [\#1558](https://github.com/youzan/vant/pull/1558) ([chenjiahan](https://github.com/chenjiahan)) - \[Improvement\] Button: add warning type [\#1558](https://github.com/youzan/vant/pull/1558) ([chenjiahan](https://github.com/chenjiahan))
- \[Improvement\] Icon: add size prop [\#1555](https://github.com/youzan/vant/pull/1555) ([chenjiahan](https://github.com/chenjiahan)) - \[Improvement\] Icon: add size prop [\#1555](https://github.com/youzan/vant/pull/1555) ([chenjiahan](https://github.com/chenjiahan))
- \[Doc\] update detail [\#1554](https://github.com/youzan/vant/pull/1554) ([chenjiahan](https://github.com/chenjiahan)) - \[Doc\] update detail [\#1554](https://github.com/youzan/vant/pull/1554) ([chenjiahan](https://github.com/chenjiahan))
- \[Improvement\] CellSwipe: add open method [\#1546](https://github.com/youzan/vant/pull/1546) ([chenjiahan](https://github.com/chenjiahan)) - \[Improvement\] SwipeCell: add open method [\#1546](https://github.com/youzan/vant/pull/1546) ([chenjiahan](https://github.com/chenjiahan))
- \[bugfix\] Button: text-size-adjust [\#1545](https://github.com/youzan/vant/pull/1545) ([chenjiahan](https://github.com/chenjiahan)) - \[bugfix\] Button: text-size-adjust [\#1545](https://github.com/youzan/vant/pull/1545) ([chenjiahan](https://github.com/chenjiahan))
- \[bugfix\] Stepper: optimize input strategy [\#1534](https://github.com/youzan/vant/pull/1534) ([chenjiahan](https://github.com/chenjiahan)) - \[bugfix\] Stepper: optimize input strategy [\#1534](https://github.com/youzan/vant/pull/1534) ([chenjiahan](https://github.com/chenjiahan))
- \[Doc\] Dialog: update usage [\#1520](https://github.com/youzan/vant/pull/1520) ([chenjiahan](https://github.com/chenjiahan)) - \[Doc\] Dialog: update usage [\#1520](https://github.com/youzan/vant/pull/1520) ([chenjiahan](https://github.com/chenjiahan))

View File

@ -22,7 +22,7 @@
**Improvements** **Improvements**
- Button: 新增 warning 类型 [\#1558](https://github.com/youzan/vant/pull/1558) - Button: 新增 warning 类型 [\#1558](https://github.com/youzan/vant/pull/1558)
- CellSwipe: 新增 open 方法 [\#1546](https://github.com/youzan/vant/pull/1546) - SwipeCell: 新增 open 方法 [\#1546](https://github.com/youzan/vant/pull/1546)
- DatetimePicker: 支持限制分钟范围 [\#1583](https://github.com/youzan/vant/pull/1583) - DatetimePicker: 支持限制分钟范围 [\#1583](https://github.com/youzan/vant/pull/1583)
- Icon: 新增 size 属性 [\#1555](https://github.com/youzan/vant/pull/1555) - Icon: 新增 size 属性 [\#1555](https://github.com/youzan/vant/pull/1555)
- Stepper: 优化禁用态样式 [\#1560](https://github.com/youzan/vant/pull/1560) - Stepper: 优化禁用态样式 [\#1560](https://github.com/youzan/vant/pull/1560)
@ -387,7 +387,7 @@
- 修复 NavBar 标题长度未限制的问题 [\#867](https://github.com/youzan/vant/pull/867) - 修复 NavBar 标题长度未限制的问题 [\#867](https://github.com/youzan/vant/pull/867)
- 修复 Button loading 状态下无法水平对齐的问题 [\#858](https://github.com/youzan/vant/pull/858) - 修复 Button loading 状态下无法水平对齐的问题 [\#858](https://github.com/youzan/vant/pull/858)
- 修复 CellSwipe 在垂直滑动时也会触发 Swipe 的问题 [\#866](https://github.com/youzan/vant/pull/866) - 修复 SwipeCell 在垂直滑动时也会触发 Swipe 的问题 [\#866](https://github.com/youzan/vant/pull/866)
- 修复 ImagePreview close 方法失效的问题 [\#864](https://github.com/youzan/vant/pull/864) - 修复 ImagePreview close 方法失效的问题 [\#864](https://github.com/youzan/vant/pull/864)
- 修复 SubmitBar 字体大小继承错误的问题 [\#857](https://github.com/youzan/vant/pull/857) - 修复 SubmitBar 字体大小继承错误的问题 [\#857](https://github.com/youzan/vant/pull/857)
- 修复 SwitchCell 文字未垂直居中的问题 [\#852](https://github.com/youzan/vant/pull/852) - 修复 SwitchCell 文字未垂直居中的问题 [\#852](https://github.com/youzan/vant/pull/852)
@ -469,7 +469,7 @@
**Improvements** **Improvements**
* AddressEdit: 新增 show-delete 属性 [\#716](https://github.com/youzan/vant/pull/716) * AddressEdit: 新增 show-delete 属性 [\#716](https://github.com/youzan/vant/pull/716)
* CellSwipe: 优化 Swipe 动画流畅度 [\#685](https://github.com/youzan/vant/pull/685) * SwipeCell: 优化 Swipe 动画流畅度 [\#685](https://github.com/youzan/vant/pull/685)
* Field: 支持配置 autosize 最大/最小高度 [\#718](https://github.com/youzan/vant/pull/718) * Field: 支持配置 autosize 最大/最小高度 [\#718](https://github.com/youzan/vant/pull/718)
* Locale: 精简 i18n 配置文档 [\#701](https://github.com/youzan/vant/pull/701) * Locale: 精简 i18n 配置文档 [\#701](https://github.com/youzan/vant/pull/701)
* PullRefresh: 支持手动触发 loading 动画 [\#684](https://github.com/youzan/vant/pull/684) * PullRefresh: 支持手动触发 loading 动画 [\#684](https://github.com/youzan/vant/pull/684)
@ -886,7 +886,7 @@
**Improvements** **Improvements**
* CellSwipe: 新增 onClose 属性,支持异步控制 [\#356](https://github.com/youzan/vant/pull/356) * SwipeCell: 新增 onClose 属性,支持异步控制 [\#356](https://github.com/youzan/vant/pull/356)
* Uploader: 支持继承原生属性 [\#357](https://github.com/youzan/vant/pull/357) * Uploader: 支持继承原生属性 [\#357](https://github.com/youzan/vant/pull/357)
* 优化本地构建速度 [\#355](https://github.com/youzan/vant/pull/355) * 优化本地构建速度 [\#355](https://github.com/youzan/vant/pull/355)
@ -1273,7 +1273,7 @@
* 新增 CellSwitch 组件 [\#95](https://github.com/youzan/vant/pull/95) * 新增 CellSwitch 组件 [\#95](https://github.com/youzan/vant/pull/95)
* Dialog: 支持通过组件的方式进行调用 [\#93](https://github.com/youzan/vant/pull/93) * Dialog: 支持通过组件的方式进行调用 [\#93](https://github.com/youzan/vant/pull/93)
* Progress: 简化 DOM 结构 [\#90](https://github.com/youzan/vant/pull/90) * Progress: 简化 DOM 结构 [\#90](https://github.com/youzan/vant/pull/90)
* CellSwipe: 性能优化,补充单元测试 [\#91](https://github.com/youzan/vant/pull/91) * SwipeCell: 性能优化,补充单元测试 [\#91](https://github.com/youzan/vant/pull/91)
### [0.8.6](https://github.com/youzan/vant/tree/v0.8.6) ### [0.8.6](https://github.com/youzan/vant/tree/v0.8.6)
@ -1377,7 +1377,7 @@
* 支持 SSR [\#40](https://github.com/youzan/vant/pull/40) * 支持 SSR [\#40](https://github.com/youzan/vant/pull/40)
* 新增多个 Icon 类型 [\#40](https://github.com/youzan/vant/pull/40) * 新增多个 Icon 类型 [\#40](https://github.com/youzan/vant/pull/40)
* 新增 CellSwipe 组件 [\#39](https://github.com/youzan/vant/pull/39) * 新增 SwipeCell 组件 [\#39](https://github.com/youzan/vant/pull/39)
* 新增 Search 组件微杂志样式 [\#38](https://github.com/youzan/vant/pull/38) * 新增 Search 组件微杂志样式 [\#38](https://github.com/youzan/vant/pull/38)
### [0.5.8](https://github.com/youzan/vant/tree/v0.5.8) ### [0.5.8](https://github.com/youzan/vant/tree/v0.5.8)

View File

@ -10,7 +10,6 @@ export default {
'button': () => wrapper(import('../../packages/button/demo'), 'button'), 'button': () => wrapper(import('../../packages/button/demo'), 'button'),
'card': () => wrapper(import('../../packages/card/demo'), 'card'), 'card': () => wrapper(import('../../packages/card/demo'), 'card'),
'cell': () => wrapper(import('../../packages/cell/demo'), 'cell'), 'cell': () => wrapper(import('../../packages/cell/demo'), 'cell'),
'cell-swipe': () => wrapper(import('../../packages/cell-swipe/demo'), 'cell-swipe'),
'checkbox': () => wrapper(import('../../packages/checkbox/demo'), 'checkbox'), 'checkbox': () => wrapper(import('../../packages/checkbox/demo'), 'checkbox'),
'circle': () => wrapper(import('../../packages/circle/demo'), 'circle'), 'circle': () => wrapper(import('../../packages/circle/demo'), 'circle'),
'col': () => wrapper(import('../../packages/col/demo'), 'col'), 'col': () => wrapper(import('../../packages/col/demo'), 'col'),
@ -45,6 +44,7 @@ export default {
'steps': () => wrapper(import('../../packages/steps/demo'), 'steps'), 'steps': () => wrapper(import('../../packages/steps/demo'), 'steps'),
'submit-bar': () => wrapper(import('../../packages/submit-bar/demo'), 'submit-bar'), 'submit-bar': () => wrapper(import('../../packages/submit-bar/demo'), 'submit-bar'),
'swipe': () => wrapper(import('../../packages/swipe/demo'), 'swipe'), 'swipe': () => wrapper(import('../../packages/swipe/demo'), 'swipe'),
'swipe-cell': () => wrapper(import('../../packages/swipe-cell/demo'), 'swipe-cell'),
'switch': () => wrapper(import('../../packages/switch/demo'), 'switch'), 'switch': () => wrapper(import('../../packages/switch/demo'), 'switch'),
'switch-cell': () => wrapper(import('../../packages/switch-cell/demo'), 'switch-cell'), 'switch-cell': () => wrapper(import('../../packages/switch-cell/demo'), 'switch-cell'),
'tab': () => wrapper(import('../../packages/tab/demo'), 'tab'), 'tab': () => wrapper(import('../../packages/tab/demo'), 'tab'),

View File

@ -245,14 +245,14 @@ module.exports = {
{ {
groupName: '高阶组件', groupName: '高阶组件',
list: [ list: [
{
path: '/cell-swipe',
title: 'CellSwipe 滑动单元格'
},
{ {
path: '/image-preview', path: '/image-preview',
title: 'ImagePreview 图片预览' title: 'ImagePreview 图片预览'
}, },
{
path: '/swipe-cell',
title: 'SwipeCell 滑动单元格'
},
{ {
path: '/switch-cell', path: '/switch-cell',
title: 'SwitchCell 开关单元格' title: 'SwitchCell 开关单元格'
@ -542,8 +542,8 @@ module.exports = {
groupName: 'Advanced Components', groupName: 'Advanced Components',
list: [ list: [
{ {
path: '/cell-swipe', path: '/swipe-cell',
title: 'CellSwipe' title: 'SwipeCell'
}, },
{ {
path: '/image-preview', path: '/image-preview',

View File

@ -27,8 +27,6 @@ export default {
'card.zh-CN': () => import('../../packages/card/zh-CN.md'), 'card.zh-CN': () => import('../../packages/card/zh-CN.md'),
'cell.en-US': () => import('../../packages/cell/en-US.md'), 'cell.en-US': () => import('../../packages/cell/en-US.md'),
'cell.zh-CN': () => import('../../packages/cell/zh-CN.md'), 'cell.zh-CN': () => import('../../packages/cell/zh-CN.md'),
'cell-swipe.en-US': () => import('../../packages/cell-swipe/en-US.md'),
'cell-swipe.zh-CN': () => import('../../packages/cell-swipe/zh-CN.md'),
'checkbox.en-US': () => import('../../packages/checkbox/en-US.md'), 'checkbox.en-US': () => import('../../packages/checkbox/en-US.md'),
'checkbox.zh-CN': () => import('../../packages/checkbox/zh-CN.md'), 'checkbox.zh-CN': () => import('../../packages/checkbox/zh-CN.md'),
'circle.en-US': () => import('../../packages/circle/en-US.md'), 'circle.en-US': () => import('../../packages/circle/en-US.md'),
@ -99,6 +97,8 @@ export default {
'submit-bar.zh-CN': () => import('../../packages/submit-bar/zh-CN.md'), 'submit-bar.zh-CN': () => import('../../packages/submit-bar/zh-CN.md'),
'swipe.en-US': () => import('../../packages/swipe/en-US.md'), 'swipe.en-US': () => import('../../packages/swipe/en-US.md'),
'swipe.zh-CN': () => import('../../packages/swipe/zh-CN.md'), 'swipe.zh-CN': () => import('../../packages/swipe/zh-CN.md'),
'swipe-cell.en-US': () => import('../../packages/swipe-cell/en-US.md'),
'swipe-cell.zh-CN': () => import('../../packages/swipe-cell/zh-CN.md'),
'switch.en-US': () => import('../../packages/switch/en-US.md'), 'switch.en-US': () => import('../../packages/switch/en-US.md'),
'switch.zh-CN': () => import('../../packages/switch/zh-CN.md'), 'switch.zh-CN': () => import('../../packages/switch/zh-CN.md'),
'switch-cell.en-US': () => import('../../packages/switch-cell/en-US.md'), 'switch-cell.en-US': () => import('../../packages/switch-cell/en-US.md'),

View File

@ -1,46 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`drag and show left part 1`] = `
<div class="van-cell-swipe">
<div class="van-cell-swipe__wrapper">
<div class="van-cell-swipe__left"></div>
<div class="van-cell-swipe__right"></div>
</div>
</div>
`;
exports[`drag and show left part 2`] = `
<div class="van-cell-swipe">
<div class="van-cell-swipe__wrapper">
<div class="van-cell-swipe__left"></div>
<div class="van-cell-swipe__right"></div>
</div>
</div>
`;
exports[`drag and show left part 3`] = `
<div class="van-cell-swipe">
<div class="van-cell-swipe__wrapper">
<div class="van-cell-swipe__left"></div>
<div class="van-cell-swipe__right"></div>
</div>
</div>
`;
exports[`drag and show left part 4`] = `
<div class="van-cell-swipe">
<div class="van-cell-swipe__wrapper">
<div class="van-cell-swipe__left"></div>
<div class="van-cell-swipe__right"></div>
</div>
</div>
`;
exports[`drag and show left part 5`] = `
<div class="van-cell-swipe">
<div class="van-cell-swipe__wrapper">
<div class="van-cell-swipe__left"></div>
<div class="van-cell-swipe__right"></div>
</div>
</div>
`;

View File

@ -9,7 +9,6 @@ import Button from './button';
import Card from './card'; import Card from './card';
import Cell from './cell'; import Cell from './cell';
import CellGroup from './cell-group'; import CellGroup from './cell-group';
import CellSwipe from './cell-swipe';
import Checkbox from './checkbox'; import Checkbox from './checkbox';
import CheckboxGroup from './checkbox-group'; import CheckboxGroup from './checkbox-group';
import Circle from './circle'; import Circle from './circle';
@ -55,6 +54,7 @@ import Stepper from './stepper';
import Steps from './steps'; import Steps from './steps';
import SubmitBar from './submit-bar'; import SubmitBar from './submit-bar';
import Swipe from './swipe'; import Swipe from './swipe';
import SwipeCell from './swipe-cell';
import SwipeItem from './swipe-item'; import SwipeItem from './swipe-item';
import Switch from './switch'; import Switch from './switch';
import SwitchCell from './switch-cell'; import SwitchCell from './switch-cell';
@ -80,7 +80,6 @@ const components = [
Card, Card,
Cell, Cell,
CellGroup, CellGroup,
CellSwipe,
Checkbox, Checkbox,
CheckboxGroup, CheckboxGroup,
Circle, Circle,
@ -125,6 +124,7 @@ const components = [
Steps, Steps,
SubmitBar, SubmitBar,
Swipe, Swipe,
SwipeCell,
SwipeItem, SwipeItem,
Switch, Switch,
SwitchCell, SwitchCell,
@ -162,7 +162,6 @@ export {
Card, Card,
Cell, Cell,
CellGroup, CellGroup,
CellSwipe,
Checkbox, Checkbox,
CheckboxGroup, CheckboxGroup,
Circle, Circle,
@ -208,6 +207,7 @@ export {
Steps, Steps,
SubmitBar, SubmitBar,
Swipe, Swipe,
SwipeCell,
SwipeItem, SwipeItem,
Switch, Switch,
SwitchCell, SwitchCell,

View File

@ -3,23 +3,23 @@
<demo-section> <demo-section>
<van-notice-bar>{{ $t('tips') }}</van-notice-bar> <van-notice-bar>{{ $t('tips') }}</van-notice-bar>
<demo-block :title="$t('basicUsage')"> <demo-block :title="$t('basicUsage')">
<van-cell-swipe :right-width="65" :left-width="65"> <van-swipe-cell :right-width="65" :left-width="65">
<span slot="left">{{ $t('button1') }}</span> <span slot="left">{{ $t('button1') }}</span>
<van-cell-group> <van-cell-group>
<van-cell :title="$t('title')" :value="$t('content')" /> <van-cell :title="$t('title')" :value="$t('content')" />
</van-cell-group> </van-cell-group>
<span slot="right">{{ $t('button2') }}</span> <span slot="right">{{ $t('button2') }}</span>
</van-cell-swipe> </van-swipe-cell>
</demo-block> </demo-block>
<demo-block :title="$t('title2')"> <demo-block :title="$t('title2')">
<van-cell-swipe :right-width="65" :left-width="65" :on-close="onClose"> <van-swipe-cell :right-width="65" :left-width="65" :on-close="onClose">
<span slot="left">{{ $t('button1') }}</span> <span slot="left">{{ $t('button1') }}</span>
<van-cell-group> <van-cell-group>
<van-cell :title="$t('title')" :value="$t('content')" /> <van-cell :title="$t('title')" :value="$t('content')" />
</van-cell-group> </van-cell-group>
<span slot="right">{{ $t('button2') }}</span> <span slot="right">{{ $t('button2') }}</span>
</van-cell-swipe> </van-swipe-cell>
</demo-block> </demo-block>
</demo-section> </demo-section>
</div> </div>
@ -68,10 +68,10 @@ export default {
</script> </script>
<style lang="postcss"> <style lang="postcss">
.demo-cell-swipe { .demo-swipe-cell {
user-select: none; user-select: none;
.van-cell-swipe { .van-swipe-cell {
&__left, &__left,
&__right { &__right {
color: #FFFFFF; color: #FFFFFF;

View File

@ -1,10 +1,10 @@
## CellSwipe ## SwipeCell
### Install ### Install
``` javascript ``` javascript
import { CellSwipe } from 'vant'; import { SwipeCell } from 'vant';
Vue.use(CellSwipe); Vue.use(SwipeCell);
``` ```
### Usage ### Usage
@ -12,25 +12,25 @@ Vue.use(CellSwipe);
#### Basic Usage #### Basic Usage
```html ```html
<van-cell-swipe :right-width="65" :left-width="65"> <van-swipe-cell :right-width="65" :left-width="65">
<span slot="left">Select</span> <span slot="left">Select</span>
<van-cell-group> <van-cell-group>
<van-cell title="Cell" value="Cell Content" /> <van-cell title="Cell" value="Cell Content" />
</van-cell-group> </van-cell-group>
<span slot="right">Delete</span> <span slot="right">Delete</span>
</van-cell-swipe> </van-swipe-cell>
``` ```
#### Async close #### Async close
```html ```html
<van-cell-swipe :right-width="65" :left-width="65" :on-close="onClose"> <van-swipe-cell :right-width="65" :left-width="65" :on-close="onClose">
<span slot="left">Select</span> <span slot="left">Select</span>
<van-cell-group> <van-cell-group>
<van-cell title="Cell" value="Cell Content" /> <van-cell title="Cell" value="Cell Content" />
</van-cell-group> </van-cell-group>
<span slot="right">Delete</span> <span slot="right">Delete</span>
</van-cell-swipe> </van-swipe-cell>
``` ```
```js ```js
@ -77,13 +77,13 @@ export default {
| Argument | Type | Description | | Argument | Type | Description |
|-----------|-----------|-----------| |-----------|-----------|-----------|
| clickPosition | `String` | Click positon (`left` `right` `cell` `outside`) | | clickPosition | `String` | Click positon (`left` `right` `cell` `outside`) |
| instance | `Object` | CellSwipe instance | | instance | `Object` | SwipeCell instance |
### Methods ### Methods
Use ref to get CellSwipe instance and call instance methods Use ref to get SwipeCell instance and call instance methods
| Name | Attribute | Return value | Description | | Name | Attribute | Return value | Description |
|-----------|-----------|-----------|-------------| |-----------|-----------|-----------|-------------|
| open | position: 'left' \| 'right' | - | open CellSwipe | | open | position: 'left' \| 'right' | - | open SwipeCell |
| close | - | - | close CellSwipe | | close | - | - | close SwipeCell |

View File

@ -32,7 +32,7 @@ import Touch from '../mixins/touch';
const THRESHOLD = 0.15; const THRESHOLD = 0.15;
export default create({ export default create({
name: 'cell-swipe', name: 'swipe-cell',
mixins: [Touch], mixins: [Touch],

View File

@ -11,9 +11,9 @@ exports[`renders demo correctly 1`] = `
<!----> <!---->
</div> </div>
<div> <div>
<div class="van-cell-swipe"> <div class="van-swipe-cell">
<div class="van-cell-swipe__wrapper" style="transform:translate3d(0px, 0, 0);transition:.6s cubic-bezier(0.18, 0.89, 0.32, 1);"> <div class="van-swipe-cell__wrapper" style="transform:translate3d(0px, 0, 0);transition:.6s cubic-bezier(0.18, 0.89, 0.32, 1);">
<div class="van-cell-swipe__left"><span>选择</span></div> <div class="van-swipe-cell__left"><span>选择</span></div>
<div class="van-cell-group van-hairline--top-bottom"> <div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-hairline"> <div class="van-cell van-hairline">
<!----> <!---->
@ -24,14 +24,14 @@ exports[`renders demo correctly 1`] = `
<!----> <!---->
</div> </div>
</div> </div>
<div class="van-cell-swipe__right"><span>删除</span></div> <div class="van-swipe-cell__right"><span>删除</span></div>
</div> </div>
</div> </div>
</div> </div>
<div> <div>
<div class="van-cell-swipe"> <div class="van-swipe-cell">
<div class="van-cell-swipe__wrapper" style="transform:translate3d(0px, 0, 0);transition:.6s cubic-bezier(0.18, 0.89, 0.32, 1);"> <div class="van-swipe-cell__wrapper" style="transform:translate3d(0px, 0, 0);transition:.6s cubic-bezier(0.18, 0.89, 0.32, 1);">
<div class="van-cell-swipe__left"><span>选择</span></div> <div class="van-swipe-cell__left"><span>选择</span></div>
<div class="van-cell-group van-hairline--top-bottom"> <div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-hairline"> <div class="van-cell van-hairline">
<!----> <!---->
@ -42,7 +42,7 @@ exports[`renders demo correctly 1`] = `
<!----> <!---->
</div> </div>
</div> </div>
<div class="van-cell-swipe__right"><span>删除</span></div> <div class="van-swipe-cell__right"><span>删除</span></div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -0,0 +1,46 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`drag and show left part 1`] = `
<div class="van-swipe-cell">
<div class="van-swipe-cell__wrapper">
<div class="van-swipe-cell__left"></div>
<div class="van-swipe-cell__right"></div>
</div>
</div>
`;
exports[`drag and show left part 2`] = `
<div class="van-swipe-cell">
<div class="van-swipe-cell__wrapper">
<div class="van-swipe-cell__left"></div>
<div class="van-swipe-cell__right"></div>
</div>
</div>
`;
exports[`drag and show left part 3`] = `
<div class="van-swipe-cell">
<div class="van-swipe-cell__wrapper">
<div class="van-swipe-cell__left"></div>
<div class="van-swipe-cell__right"></div>
</div>
</div>
`;
exports[`drag and show left part 4`] = `
<div class="van-swipe-cell">
<div class="van-swipe-cell__wrapper">
<div class="van-swipe-cell__left"></div>
<div class="van-swipe-cell__right"></div>
</div>
</div>
`;
exports[`drag and show left part 5`] = `
<div class="van-swipe-cell">
<div class="van-swipe-cell__wrapper">
<div class="van-swipe-cell__left"></div>
<div class="van-swipe-cell__right"></div>
</div>
</div>
`;

View File

@ -1,4 +1,4 @@
import CellSwipe from '..'; import SwipeCell from '..';
import { mount, triggerDrag } from '../../../test/utils'; import { mount, triggerDrag } from '../../../test/utils';
const defaultProps = { const defaultProps = {
@ -9,7 +9,7 @@ const defaultProps = {
}; };
it('drag and show left part', () => { it('drag and show left part', () => {
const wrapper = mount(CellSwipe, defaultProps); const wrapper = mount(SwipeCell, defaultProps);
triggerDrag(wrapper, 10, 0); triggerDrag(wrapper, 10, 0);
expect(wrapper).toMatchSnapshot(); expect(wrapper).toMatchSnapshot();
@ -25,7 +25,7 @@ it('drag and show left part', () => {
}); });
it('drag and show left part', () => { it('drag and show left part', () => {
const wrapper = mount(CellSwipe, defaultProps); const wrapper = mount(SwipeCell, defaultProps);
triggerDrag(wrapper, -50, 0); triggerDrag(wrapper, -50, 0);
expect(wrapper).toMatchSnapshot(); expect(wrapper).toMatchSnapshot();
@ -35,7 +35,7 @@ test('on close prop', () => {
let position; let position;
let instance; let instance;
const wrapper = mount(CellSwipe, { const wrapper = mount(SwipeCell, {
propsData: { propsData: {
...defaultProps.propsData, ...defaultProps.propsData,
onClose(pos, ins) { onClose(pos, ins) {
@ -51,10 +51,10 @@ test('on close prop', () => {
wrapper.trigger('click'); wrapper.trigger('click');
expect(position).toEqual('cell'); expect(position).toEqual('cell');
wrapper.find('.van-cell-swipe__left').trigger('click'); wrapper.find('.van-swipe-cell__left').trigger('click');
expect(position).toEqual('left'); expect(position).toEqual('left');
wrapper.find('.van-cell-swipe__right').trigger('click'); wrapper.find('.van-swipe-cell__right').trigger('click');
expect(position).toEqual('right'); expect(position).toEqual('right');
instance.close(); instance.close();

View File

@ -1,10 +1,10 @@
## CellSwipe 滑动单元格 ## SwipeCell 滑动单元格
### 使用指南 ### 使用指南
``` javascript ``` javascript
import { CellSwipe } from 'vant'; import { SwipeCell } from 'vant';
Vue.use(CellSwipe); Vue.use(SwipeCell);
``` ```
### 代码演示 ### 代码演示
@ -12,25 +12,25 @@ Vue.use(CellSwipe);
#### 基础用法 #### 基础用法
```html ```html
<van-cell-swipe :right-width="65" :left-width="65"> <van-swipe-cell :right-width="65" :left-width="65">
<span slot="left">选择</span> <span slot="left">选择</span>
<van-cell-group> <van-cell-group>
<van-cell title="单元格" value="内容" /> <van-cell title="单元格" value="内容" />
</van-cell-group> </van-cell-group>
<span slot="right">删除</span> <span slot="right">删除</span>
</van-cell-swipe> </van-swipe-cell>
``` ```
#### 异步关闭 #### 异步关闭
```html ```html
<van-cell-swipe :right-width="65" :left-width="65" :on-close="onClose"> <van-swipe-cell :right-width="65" :left-width="65" :on-close="onClose">
<span slot="left">选择</span> <span slot="left">选择</span>
<van-cell-group> <van-cell-group>
<van-cell title="单元格" value="内容" /> <van-cell title="单元格" value="内容" />
</van-cell-group> </van-cell-group>
<span slot="right">删除</span> <span slot="right">删除</span>
</van-cell-swipe> </van-swipe-cell>
``` ```
```js ```js
@ -77,11 +77,11 @@ export default {
| 参数 | 类型 | 说明 | | 参数 | 类型 | 说明 |
|-----------|-----------|-----------| |-----------|-----------|-----------|
| clickPosition | `String` | 关闭时的点击位置 (`left` `right` `cell` `outside`) | | clickPosition | `String` | 关闭时的点击位置 (`left` `right` `cell` `outside`) |
| instance | `Object` | CellSwipe 实例 | | instance | `Object` | SwipeCell 实例 |
### 方法 ### 方法
通过 ref 可以获取到 CellSwipe 实例并调用实例方法 通过 ref 可以获取到 SwipeCell 实例并调用实例方法
| 方法名 | 参数 | 返回值 | 介绍 | | 方法名 | 参数 | 返回值 | 介绍 |
|-----------|-----------|-----------|-------------| |-----------|-----------|-----------|-------------|

View File

@ -46,7 +46,7 @@
@import './toast.css'; @import './toast.css';
/* high order components */ /* high order components */
@import './cell-swipe.css'; @import './swipe-cell.css';
@import './switch-cell.css'; @import './switch-cell.css';
@import './tree-select.css'; @import './tree-select.css';

View File

@ -1,6 +1,6 @@
@import './common/var.css'; @import './common/var.css';
.van-cell-swipe { .van-swipe-cell {
overflow: hidden; overflow: hidden;
position: relative; position: relative;

2
types/index.d.ts vendored
View File

@ -19,7 +19,7 @@ export class Button extends VanComponent {}
export class Card extends VanComponent {} export class Card extends VanComponent {}
export class Cell extends VanComponent {} export class Cell extends VanComponent {}
export class CellGroup extends VanComponent {} export class CellGroup extends VanComponent {}
export class CellSwipe extends VanComponent {} export class SwipeCell extends VanComponent {}
export class Checkbox extends VanComponent {} export class Checkbox extends VanComponent {}
export class CheckboxGroup extends VanComponent {} export class CheckboxGroup extends VanComponent {}
export class Circle extends VanComponent {} export class Circle extends VanComponent {}