@tuya-miniapp/smart-ui 2.3.2-beta-1 → 2.3.2-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.
@@ -30,7 +30,9 @@ SmartComponent({
30
30
  }
31
31
  },
32
32
  } }),
33
- data: {},
33
+ data: {
34
+ animating: false,
35
+ },
34
36
  beforeCreate() {
35
37
  Object.defineProperty(this, 'children', {
36
38
  get: () => this.selectAllComponents('.smart-picker__column') || [],
@@ -143,21 +145,20 @@ SmartComponent({
143
145
  return Promise.all(stack);
144
146
  },
145
147
  animationStart() {
146
- if (this.animating)
148
+ if (this.data.animating)
147
149
  return;
148
- this.animating = true;
150
+ this.setData({
151
+ animating: true,
152
+ });
149
153
  this.$emit('animation-start');
150
154
  },
151
155
  animationEnd() {
152
- const { endTimeout } = this;
153
- if (endTimeout) {
154
- clearTimeout(endTimeout);
155
- }
156
- this.endTimeout = setTimeout(() => {
157
- this.$emit('animation-end');
158
- this.animating = false;
159
- this.endTimeout = null;
160
- }, 300);
156
+ if (!this.data.animating)
157
+ return;
158
+ this.setData({
159
+ animating: false,
160
+ });
161
+ this.$emit('animation-end');
161
162
  },
162
163
  },
163
164
  });
@@ -44,7 +44,9 @@ var shared_1 = require("./shared");
44
44
  }
45
45
  },
46
46
  } }),
47
- data: {},
47
+ data: {
48
+ animating: false,
49
+ },
48
50
  beforeCreate: function () {
49
51
  var _this = this;
50
52
  Object.defineProperty(this, 'children', {
@@ -166,22 +168,20 @@ var shared_1 = require("./shared");
166
168
  return Promise.all(stack);
167
169
  },
168
170
  animationStart: function () {
169
- if (this.animating)
171
+ if (this.data.animating)
170
172
  return;
171
- this.animating = true;
173
+ this.setData({
174
+ animating: true,
175
+ });
172
176
  this.$emit('animation-start');
173
177
  },
174
178
  animationEnd: function () {
175
- var _this = this;
176
- var endTimeout = this.endTimeout;
177
- if (endTimeout) {
178
- clearTimeout(endTimeout);
179
- }
180
- this.endTimeout = setTimeout(function () {
181
- _this.$emit('animation-end');
182
- _this.animating = false;
183
- _this.endTimeout = null;
184
- }, 300);
179
+ if (!this.data.animating)
180
+ return;
181
+ this.setData({
182
+ animating: false,
183
+ });
184
+ this.$emit('animation-end');
185
185
  },
186
186
  },
187
187
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.3.2-beta-1",
3
+ "version": "2.3.2-beta-2",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",