[!] WxcSwipeAction 删除最后一个数据项,再点击其他项动画报错
diff --git a/example/swipe-action/index.vue b/example/swipe-action/index.vue
index 105a592..daed861 100644
--- a/example/swipe-action/index.vue
+++ b/example/swipe-action/index.vue
@@ -69,6 +69,7 @@
{
text: "删除",
onPress: () => {
+ this.data.splice(1, 1)
modal.toast({
message: "删除",
duration: 0.3
diff --git a/packages/wxc-swipe-action/index.vue b/packages/wxc-swipe-action/index.vue
index 85ad59e..ba1cbd0 100644
--- a/packages/wxc-swipe-action/index.vue
+++ b/packages/wxc-swipe-action/index.vue
@@ -132,7 +132,7 @@
},
onPanStart: function(e, node, i) {
const { saveIdx } = this;
- if (saveIdx !== i && saveIdx !== null) {
+ if (saveIdx !== i && saveIdx !== null && this.$refs.skid[saveIdx]) {
this.special(this.$refs.skid[saveIdx], {
transform: `translate(0, 0)`
});