From 6e1c1fb51c89109263d182fc0fb69fa8ed8d5fa2 Mon Sep 17 00:00:00 2001
From: wwlh200
Date: Wed, 9 Nov 2022 11:01:07 +0800
Subject: [PATCH 1/2] docs(swipe-cell): update docs and demo
---
.../__test__/__snapshots__/demo.test.jsx.snap | 413 ++++++++++++++++++
src/swipe-cell/demos/bind.vue | 36 +-
src/swipe-cell/demos/btns.vue | 31 +-
src/swipe-cell/demos/content.vue | 10 +-
src/swipe-cell/demos/disabled.vue | 22 +-
src/swipe-cell/demos/event.vue | 47 +-
src/swipe-cell/demos/left-card.vue | 16 +-
src/swipe-cell/demos/left-more-menu.vue | 17 +-
src/swipe-cell/demos/left-one-menu.vue | 16 +-
src/swipe-cell/demos/left-two-menu.vue | 39 +-
src/swipe-cell/demos/mobile.vue | 116 +++--
src/swipe-cell/demos/right-menu.vue | 16 +-
12 files changed, 579 insertions(+), 200 deletions(-)
diff --git a/src/swipe-cell/__test__/__snapshots__/demo.test.jsx.snap b/src/swipe-cell/__test__/__snapshots__/demo.test.jsx.snap
index 26e206614..b84df5a1f 100644
--- a/src/swipe-cell/__test__/__snapshots__/demo.test.jsx.snap
+++ b/src/swipe-cell/__test__/__snapshots__/demo.test.jsx.snap
@@ -2293,6 +2293,419 @@ exports[`SwipeCell > SwipeCell mobileVue demo works fine 1`] = `
+
+
+
+ 通过直接传入内容或者使用 slot#content 来渲染
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 是否启用滑动功能
+
+
+
+
+
+
+
+
+ 开关
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 可以滑动
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 左右两侧都有菜单
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 左右都有菜单
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 点击事件
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 左右都有内容
+
+
+
+
+ 辅助信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
`;
diff --git a/src/swipe-cell/demos/bind.vue b/src/swipe-cell/demos/bind.vue
index 20fcf18b7..bf8676a55 100644
--- a/src/swipe-cell/demos/bind.vue
+++ b/src/swipe-cell/demos/bind.vue
@@ -14,33 +14,23 @@
-
diff --git a/src/swipe-cell/demos/btns.vue b/src/swipe-cell/demos/btns.vue
index 10b9fbaf0..6caba2e5a 100644
--- a/src/swipe-cell/demos/btns.vue
+++ b/src/swipe-cell/demos/btns.vue
@@ -15,28 +15,19 @@
-
diff --git a/src/swipe-cell/demos/content.vue b/src/swipe-cell/demos/content.vue
index 6900672b7..3bd666eaa 100644
--- a/src/swipe-cell/demos/content.vue
+++ b/src/swipe-cell/demos/content.vue
@@ -14,12 +14,4 @@
-
+
diff --git a/src/swipe-cell/demos/disabled.vue b/src/swipe-cell/demos/disabled.vue
index 5c553ec71..fef0d3e59 100644
--- a/src/swipe-cell/demos/disabled.vue
+++ b/src/swipe-cell/demos/disabled.vue
@@ -13,21 +13,13 @@
-
diff --git a/src/swipe-cell/demos/event.vue b/src/swipe-cell/demos/event.vue
index 9d5f6a72a..dff32c896 100644
--- a/src/swipe-cell/demos/event.vue
+++ b/src/swipe-cell/demos/event.vue
@@ -9,36 +9,27 @@
-
diff --git a/src/swipe-cell/demos/left-card.vue b/src/swipe-cell/demos/left-card.vue
index 20feb10ba..3abe9ffe9 100644
--- a/src/swipe-cell/demos/left-card.vue
+++ b/src/swipe-cell/demos/left-card.vue
@@ -33,18 +33,10 @@
-
diff --git a/src/swipe-cell/demos/left-more-menu.vue b/src/swipe-cell/demos/left-more-menu.vue
index 31241d5c3..d7a4d57eb 100644
--- a/src/swipe-cell/demos/left-more-menu.vue
+++ b/src/swipe-cell/demos/left-more-menu.vue
@@ -21,19 +21,10 @@
-
diff --git a/src/swipe-cell/demos/left-one-menu.vue b/src/swipe-cell/demos/left-one-menu.vue
index 36c3a720c..9b12959f7 100644
--- a/src/swipe-cell/demos/left-one-menu.vue
+++ b/src/swipe-cell/demos/left-one-menu.vue
@@ -19,18 +19,10 @@
-
diff --git a/src/swipe-cell/demos/left-two-menu.vue b/src/swipe-cell/demos/left-two-menu.vue
index 74ab9c4c4..3e420ef7d 100644
--- a/src/swipe-cell/demos/left-two-menu.vue
+++ b/src/swipe-cell/demos/left-two-menu.vue
@@ -11,32 +11,29 @@
-
diff --git a/src/swipe-cell/demos/mobile.vue b/src/swipe-cell/demos/mobile.vue
index ec2f975b0..fa7f92c22 100644
--- a/src/swipe-cell/demos/mobile.vue
+++ b/src/swipe-cell/demos/mobile.vue
@@ -105,11 +105,58 @@
+
+
+
+ 使用slot#content
+
+ 直接写组件
+
+
+ 收藏
+
+
+
+
+
+
+ handleDisabledChange(value)">
+
+
+
+
+ 收藏
+ 删除
+
+
+
+
+
+
+
+ 选择
+
+
+
+ 收藏
+ 删除
+
+
+
+
+
+
+
+
+ 选择
+
+
+
-
diff --git a/src/swipe-cell/demos/right-menu.vue b/src/swipe-cell/demos/right-menu.vue
index f05bb6ac2..f68a82097 100644
--- a/src/swipe-cell/demos/right-menu.vue
+++ b/src/swipe-cell/demos/right-menu.vue
@@ -17,18 +17,10 @@
-
From d6c241f86f190ebc84f5cceb4970f9a0b37685f8 Mon Sep 17 00:00:00 2001
From: wwlh200
Date: Thu, 10 Nov 2022 11:30:36 +0800
Subject: [PATCH 2/2] docs(swipe-cell): update docs and demo
---
.../__test__/__snapshots__/demo.test.jsx.snap | 230 +++++++++++-------
src/swipe-cell/demos/bind.vue | 24 +-
src/swipe-cell/demos/btns.vue | 4 +-
src/swipe-cell/demos/content.vue | 4 +-
src/swipe-cell/demos/disabled.vue | 4 +-
src/swipe-cell/demos/event.vue | 4 +-
src/swipe-cell/demos/left-card.vue | 58 +++--
src/swipe-cell/demos/left-one-menu.vue | 34 ++-
src/swipe-cell/demos/mobile.vue | 212 ++--------------
9 files changed, 219 insertions(+), 355 deletions(-)
diff --git a/src/swipe-cell/__test__/__snapshots__/demo.test.jsx.snap b/src/swipe-cell/__test__/__snapshots__/demo.test.jsx.snap
index b84df5a1f..667c00d6f 100644
--- a/src/swipe-cell/__test__/__snapshots__/demo.test.jsx.snap
+++ b/src/swipe-cell/__test__/__snapshots__/demo.test.jsx.snap
@@ -2,125 +2,128 @@
exports[`SwipeCell > SwipeCell bindVue demo works fine 1`] = `
+
+
+ 通过expanded实现父子组件联动
+
+
-
-
- 通过expanded实现父子组件联动
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
- 开关
-
-
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
+
+
+
+
+ 删除
+
+
+
+
+
+
-
+
`;
exports[`SwipeCell > SwipeCell btnsVue demo works fine 1`] = `
+
+
+ 左右两侧都有菜单
+
+
@@ -217,13 +220,21 @@ exports[`SwipeCell > SwipeCell btnsVue demo works fine 1`] = `
+
`;
exports[`SwipeCell > SwipeCell contentVue demo works fine 1`] = `
+
+
+ 通过直接传入内容或者使用 slot#content 来渲染
+
+
@@ -279,13 +290,21 @@ exports[`SwipeCell > SwipeCell contentVue demo works fine 1`] = `
+
`;
exports[`SwipeCell > SwipeCell disabledVue demo works fine 1`] = `
+
+
+ 是否启用滑动功能
+
+
@@ -400,13 +419,21 @@ exports[`SwipeCell > SwipeCell disabledVue demo works fine 1`] = `
+
`;
exports[`SwipeCell > SwipeCell eventVue demo works fine 1`] = `
+
+
+ 点击事件
+
+
@@ -507,13 +534,15 @@ exports[`SwipeCell > SwipeCell eventVue demo works fine 1`] = `
+
`;
exports[`SwipeCell > SwipeCell leftCardVue demo works fine 1`] = `
+
@@ -683,6 +712,7 @@ exports[`SwipeCell > SwipeCell leftCardVue demo works fine 1`] = `
+
`;
@@ -912,8 +942,9 @@ exports[`SwipeCell > SwipeCell leftMoreMenuVue demo works fine 1`] = `
exports[`SwipeCell > SwipeCell leftOneMenuVue demo works fine 1`] = `
+
@@ -1073,6 +1104,7 @@ exports[`SwipeCell > SwipeCell leftOneMenuVue demo works fine 1`] = `
+
`;
@@ -1290,6 +1322,7 @@ exports[`SwipeCell > SwipeCell mobileVue demo works fine 1`] = `
>
用来承载列表中的更多操作,通过左右滑动来展示,按钮的宽度固定高度根据列表高度而变化。
+
@@ -1449,6 +1482,8 @@ exports[`SwipeCell > SwipeCell mobileVue demo works fine 1`] = `
+
+
@@ -1640,6 +1675,8 @@ exports[`SwipeCell > SwipeCell mobileVue demo works fine 1`] = `
+
+
@@ -1855,6 +1892,8 @@ exports[`SwipeCell > SwipeCell mobileVue demo works fine 1`] = `
+
+
@@ -2024,6 +2063,8 @@ exports[`SwipeCell > SwipeCell mobileVue demo works fine 1`] = `
+
+
@@ -2183,6 +2224,7 @@ exports[`SwipeCell > SwipeCell mobileVue demo works fine 1`] = `
+
@@ -2672,7 +2714,7 @@ exports[`SwipeCell > SwipeCell mobileVue demo works fine 1`] = `
@@ -2681,13 +2723,13 @@ exports[`SwipeCell > SwipeCell mobileVue demo works fine 1`] = `
class="t-button__text"
>
- 编辑
+ 删除
@@ -2696,7 +2738,7 @@ exports[`SwipeCell > SwipeCell mobileVue demo works fine 1`] = `
class="t-button__text"
>
- 删除
+ 收藏
diff --git a/src/swipe-cell/demos/bind.vue b/src/swipe-cell/demos/bind.vue
index bf8676a55..9a32205bf 100644
--- a/src/swipe-cell/demos/bind.vue
+++ b/src/swipe-cell/demos/bind.vue
@@ -1,17 +1,15 @@
-
-
-
- handleChangeSwitch(value)" />
-
- handleChange(value)">
-
-
- 删除
-
-
-
-
+
+
+ handleChangeSwitch(value)" />
+
+ handleChange(value)">
+
+
+ 删除
+
+
+
diff --git a/src/swipe-cell/demos/disabled.vue b/src/swipe-cell/demos/disabled.vue
index fef0d3e59..277a51fcc 100644
--- a/src/swipe-cell/demos/disabled.vue
+++ b/src/swipe-cell/demos/disabled.vue
@@ -1,5 +1,5 @@
-
+
handleChange(value)">
@@ -10,7 +10,7 @@
删除
-
+