<template>
<view>
<button @click="canvasImage.generateImage">分享报告<button>
<view id="report"></view>
</view>
</template>
<script module="canvasImage" lang="renderjs">
import html2canvas from "html2canvas";
export default {
methods: {
generateImage() {
setTimeout(() => {
const dom = document.getElementById('report'); // 需要生成图片内容的 dom 节点
html2canvas(dom, {
....,
}).then((canvas) => {
......
}).catch(err=>{
.......
});
}, 300);
},
}
}
</script>

- 发布:2024-10-16 17:17
- 更新:2024-10-18 16:06
- 阅读:189
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: 版本Windows 10 专业版;版本号:21H2;操作系统内部版本:19044.3086
手机系统: HarmonyOS NEXT
手机系统版本号: HarmonyOS NEXT Developer Beta2
手机厂商: 华为
手机机型: HUAWEI Mate 60(软件版本:NEXT.0.0.71(SP6C00E71R4P17patch02))
页面类型: vue
vue版本: vue3
打包方式: 云端
项目创建方式: CLI
CLI版本号: 4.29
示例代码:
操作步骤:
鸿蒙next真机无法调用renderjs中声明函数(无法触发函数执行,但是鸿蒙模拟器上可以执行,但是$ownerInstance.callMethod调用异常)
鸿蒙next真机无法调用renderjs中声明函数(无法触发函数执行,但是鸿蒙模拟器上可以执行,但是$ownerInstance.callMethod调用异常)
预期结果:
renderjs以及$ownerInstance.callMethod适配鸿蒙next
renderjs以及$ownerInstance.callMethod适配鸿蒙next
实际结果:
renderjs以及$ownerInstance.callMethod暂时不支持鸿蒙next
renderjs以及$ownerInstance.callMethod暂时不支持鸿蒙next
bug描述:
鸿蒙next真机无法调用renderjs中声明函数(无法触发函数执行,但是鸿蒙模拟器上可以执行,但是$ownerInstance.callMethod调用异常)
1 个回复
DCloud_UNI_LXH
4.31 支持