emacroh5lib 1.0.11 → 1.0.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emacroh5lib",
3
- "version": "1.0.11",
3
+ "version": "1.0.14",
4
4
  "description": "EMacro前端组件库",
5
5
  "main": "dist/emacroh5lib.min.js",
6
6
  "scripts": {
@@ -208,14 +208,6 @@ export default {
208
208
  this.parentWidth = this.parentW ? this.parentW : this.parentElement.clientWidth;
209
209
  this.parentHeight = this.parentH ? this.parentH : this.parentElement.clientHeight;
210
210
 
211
- if (this.name.trim() !== '' && this.isStorage) {
212
- let info = JSON.parse(localStorage.getItem("DragResizeView_Info_" + this.name))
213
- this.x = info.left
214
- this.y = info.top
215
- this.w = info.width
216
- this.h = info.height
217
- }
218
-
219
211
  this.left = this.x;
220
212
  this.top = this.y;
221
213
  this.right = this.parentWidth - (this.w === 'auto' ? this.$refs.container.scrollWidth : this.w) - this.left;
@@ -245,6 +237,16 @@ export default {
245
237
  cancelHandle.setAttribute('data-drag-cancel', this._uid);
246
238
  });
247
239
  }
240
+
241
+ if (this.name.trim() !== '' && this.isStorage) {
242
+ let info = JSON.parse(localStorage.getItem("DragResizeView_Info_" + this.name))
243
+ if (info !== null) {
244
+ this.left = info.left
245
+ this.top = info.top
246
+ this.right = info.right
247
+ this.bottom = info.bottom
248
+ }
249
+ }
248
250
  },
249
251
 
250
252
  beforeDestroy() {
@@ -709,7 +711,8 @@ export default {
709
711
  throw "unspecified name"
710
712
  }
711
713
 
712
- localStorage.setItem("DragResizeView_Info_" + this.name, JSON.stringify(this.rect))
714
+ const info = { "left": this.rect.left, "top": this.rect.top, "right": this.right, "bottom": this.bottom }
715
+ localStorage.setItem("DragResizeView_Info_" + this.name, JSON.stringify(info))
713
716
  }
714
717
 
715
718
  },