@mptw/skylens-ui 1.4.85 → 1.4.86
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.
|
@@ -243,13 +243,18 @@ export default defineComponent({
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
async function
|
|
246
|
+
async function copyImageToClipboard() {
|
|
247
|
+
if (!navigator.clipboard) {
|
|
248
|
+
console.log("Can not copy image to clipboard!");
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
247
251
|
const dataURL = await domToPngDataUrl(imageTarget.value, customFilter.value, customStyle.value, padding.value, dateRanges.value, watermark.value, WatermarkImage);
|
|
248
252
|
if (!dataURL) {
|
|
249
253
|
console.log("Can not generate data URL!");
|
|
250
254
|
return;
|
|
251
255
|
}
|
|
252
|
-
|
|
256
|
+
|
|
257
|
+
await navigator.clipboard.writeText(dataURL);
|
|
253
258
|
}
|
|
254
259
|
|
|
255
260
|
onMounted(() => {
|
|
@@ -275,7 +280,7 @@ export default defineComponent({
|
|
|
275
280
|
popupEl,
|
|
276
281
|
onClickedToggle,
|
|
277
282
|
onClickedOption,
|
|
278
|
-
|
|
283
|
+
copyImageToClipboard,
|
|
279
284
|
};
|
|
280
285
|
},
|
|
281
286
|
});
|