emacroh5lib 1.0.34 → 1.0.37
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
@@ -88,12 +88,6 @@
|
|
88
88
|
alt: {
|
89
89
|
type: String,
|
90
90
|
default: "加载失败...",
|
91
|
-
},
|
92
|
-
loadComplete: {
|
93
|
-
type: Function,
|
94
|
-
default: function () {
|
95
|
-
console.log("loadComplete");
|
96
|
-
}
|
97
91
|
}
|
98
92
|
},
|
99
93
|
computed: {
|
@@ -161,12 +155,12 @@
|
|
161
155
|
height: `${imageObject.height}px`,
|
162
156
|
};
|
163
157
|
|
164
|
-
resolve(
|
158
|
+
resolve("");
|
165
159
|
imageObject.onload = null
|
166
160
|
};
|
167
161
|
|
168
162
|
imageObject.onerror = function (event) {
|
169
|
-
resolve(
|
163
|
+
resolve("");
|
170
164
|
imageObject.onerror = null
|
171
165
|
};
|
172
166
|
|
@@ -175,25 +169,30 @@
|
|
175
169
|
);
|
176
170
|
});
|
177
171
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
172
|
+
Promise.all(promises).then((data) => {
|
173
|
+
// this.image = this.$refs["duoViewerImage"];
|
174
|
+
// this.initDrag();
|
175
|
+
// const { width, height } = $this.listDataCache[index];
|
176
|
+
// $this.setStyleByName($this.image, "width", width);
|
177
|
+
// $this.setStyleByName($this.image, "height", height);
|
178
|
+
|
179
|
+
$this.image = $this.$refs["duoViewerImage"];
|
180
|
+
console.log("Promise.all", $this.image);
|
181
|
+
$this.initDrag();
|
182
|
+
this.$emit("loadComplete");
|
183
|
+
const { width, height } = $this.listDataCache[index];
|
184
|
+
$this.setStyleByName($this.image, "width", width);
|
185
|
+
$this.setStyleByName($this.image, "height", height);
|
186
|
+
})
|
185
187
|
|
186
188
|
Promise.race(promises).then((data) => {
|
187
|
-
this.image = this.$refs["duoViewerImage"];
|
188
|
-
this.
|
189
|
-
this.
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
} catch (error) {
|
195
|
-
console.log("promises", error);
|
196
|
-
}
|
189
|
+
$this.image = $this.$refs["duoViewerImage"];
|
190
|
+
console.log("Promise.race", $this.image);
|
191
|
+
$this.initDrag();
|
192
|
+
this.$emit("loadComplete");
|
193
|
+
const { width, height } = $this.listDataCache[index];
|
194
|
+
$this.setStyleByName($this.image, "width", width);
|
195
|
+
$this.setStyleByName($this.image, "height", height);
|
197
196
|
})
|
198
197
|
|
199
198
|
},
|
@@ -63,12 +63,12 @@ export default class TestView extends Vue {
|
|
63
63
|
|
64
64
|
public currentIndex: Number = 0; // 打开图片查看器时,需要定位到的图片的索引
|
65
65
|
public srcList: Array<String> = [
|
66
|
-
"http://172.16.1.83:18019/EMacroApi/GetFile?type=0&path=C:\\MES\\EMacroAndroidServer_Windows_v1.1\\EMacroAssets\\file\\%E6%97%A0%E6%A0%87%E9%A2%98.png",
|
67
|
-
"https://scpic.chinaz.net/files/pic/pic9/202203/apic39703.jpg",
|
68
|
-
"https://scpic.chinaz.net/files/pic/pic9/202005/zzpic24899.jpg",
|
69
|
-
"https://scpic.chinaz.net/files/pic/pic9/202109/bpic24244.jpg",
|
70
|
-
"https://scpic.chinaz.net/files/pic/pic9/202110/hpic4529.jpg",
|
71
|
-
"https://scpic.chinaz.net/files/pic/pic9/201912/zzpic22106.jpg",
|
66
|
+
// "http://172.16.1.83:18019/EMacroApi/GetFile?type=0&path=C:\\MES\\EMacroAndroidServer_Windows_v1.1\\EMacroAssets\\file\\%E6%97%A0%E6%A0%87%E9%A2%98.png",
|
67
|
+
// "https://scpic.chinaz.net/files/pic/pic9/202203/apic39703.jpg",
|
68
|
+
// "https://scpic.chinaz.net/files/pic/pic9/202005/zzpic24899.jpg",
|
69
|
+
// "https://scpic.chinaz.net/files/pic/pic9/202109/bpic24244.jpg",
|
70
|
+
// "https://scpic.chinaz.net/files/pic/pic9/202110/hpic4529.jpg",
|
71
|
+
// "https://scpic.chinaz.net/files/pic/pic9/201912/zzpic22106.jpg",
|
72
72
|
"https://scpic.chinaz.net/files/pic/pic9/202202/apic38580.jpg",
|
73
73
|
] // 图片查看器数据集
|
74
74
|
public showViewer: Boolean = false // 是否打开图片查看器
|