@tuya-miniapp/smart-ui 2.6.4-beta-0 → 2.6.4-beta-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/swipe-cell/index.js +11 -2
- package/lib/swipe-cell/index.js +11 -2
- package/package.json +1 -1
package/dist/swipe-cell/index.js
CHANGED
@@ -34,6 +34,7 @@ SmartComponent({
|
|
34
34
|
data: {
|
35
35
|
catchMove: false,
|
36
36
|
wrapperStyle: '',
|
37
|
+
position: 'close',
|
37
38
|
},
|
38
39
|
created() {
|
39
40
|
this.offset = 0;
|
@@ -47,13 +48,21 @@ SmartComponent({
|
|
47
48
|
const { leftWidth, rightWidth } = this.data;
|
48
49
|
const offset = position === 'left' ? leftWidth : -rightWidth;
|
49
50
|
this.swipeMove(offset);
|
51
|
+
if (position !== this.data.position && this.data.position !== 'close') {
|
52
|
+
this.$emit('tabClose', this.data.position);
|
53
|
+
}
|
54
|
+
this.setData({ position });
|
50
55
|
this.$emit('open', {
|
51
56
|
position,
|
52
57
|
name: this.data.name,
|
53
58
|
});
|
54
59
|
},
|
55
60
|
close() {
|
61
|
+
if (this.data.position !== 'close') {
|
62
|
+
this.$emit('tabClose', this.data.position);
|
63
|
+
}
|
56
64
|
this.swipeMove(0);
|
65
|
+
this.setData({ position: 'close' });
|
57
66
|
},
|
58
67
|
swipeMove(offset = 0) {
|
59
68
|
this.offset = range(offset, -this.data.rightWidth, this.data.leftWidth);
|
@@ -78,7 +87,7 @@ SmartComponent({
|
|
78
87
|
this.open('left');
|
79
88
|
}
|
80
89
|
else {
|
81
|
-
this.
|
90
|
+
this.close();
|
82
91
|
}
|
83
92
|
this.setData({ catchMove: false });
|
84
93
|
},
|
@@ -124,7 +133,7 @@ SmartComponent({
|
|
124
133
|
});
|
125
134
|
}
|
126
135
|
else {
|
127
|
-
this.
|
136
|
+
this.close();
|
128
137
|
}
|
129
138
|
},
|
130
139
|
},
|
package/lib/swipe-cell/index.js
CHANGED
@@ -38,6 +38,7 @@ var ARRAY = [];
|
|
38
38
|
data: {
|
39
39
|
catchMove: false,
|
40
40
|
wrapperStyle: '',
|
41
|
+
position: 'close',
|
41
42
|
},
|
42
43
|
created: function () {
|
43
44
|
this.offset = 0;
|
@@ -52,13 +53,21 @@ var ARRAY = [];
|
|
52
53
|
var _a = this.data, leftWidth = _a.leftWidth, rightWidth = _a.rightWidth;
|
53
54
|
var offset = position === 'left' ? leftWidth : -rightWidth;
|
54
55
|
this.swipeMove(offset);
|
56
|
+
if (position !== this.data.position && this.data.position !== 'close') {
|
57
|
+
this.$emit('tabClose', this.data.position);
|
58
|
+
}
|
59
|
+
this.setData({ position: position });
|
55
60
|
this.$emit('open', {
|
56
61
|
position: position,
|
57
62
|
name: this.data.name,
|
58
63
|
});
|
59
64
|
},
|
60
65
|
close: function () {
|
66
|
+
if (this.data.position !== 'close') {
|
67
|
+
this.$emit('tabClose', this.data.position);
|
68
|
+
}
|
61
69
|
this.swipeMove(0);
|
70
|
+
this.setData({ position: 'close' });
|
62
71
|
},
|
63
72
|
swipeMove: function (offset) {
|
64
73
|
if (offset === void 0) { offset = 0; }
|
@@ -79,7 +88,7 @@ var ARRAY = [];
|
|
79
88
|
this.open('left');
|
80
89
|
}
|
81
90
|
else {
|
82
|
-
this.
|
91
|
+
this.close();
|
83
92
|
}
|
84
93
|
this.setData({ catchMove: false });
|
85
94
|
},
|
@@ -126,7 +135,7 @@ var ARRAY = [];
|
|
126
135
|
});
|
127
136
|
}
|
128
137
|
else {
|
129
|
-
this.
|
138
|
+
this.close();
|
130
139
|
}
|
131
140
|
},
|
132
141
|
},
|