We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var jm = new jsMind(options); jm.show(mind); // 找到 JSMind.js 实例所在的容器元素 var container = document.getElementById('jsmind_container'); // 根据实际情况替换为你的容器元素
// 创建一个 canvas 元素,用于绘制思维导图 var canvas = document.createElement('canvas'); canvas.width = container.offsetWidth; canvas.height = container.offsetHeight; // 获取 canvas 的绘图上下文 var ctx = canvas.getContext('2d'); // 将 jm 实例的画布绘制到 canvas 上 jm.view.show(function(data) { debugger; ctx.clearRect(0, 0, canvas.width, canvas.height); // 清空 canvas ctx.drawImage(data.canvas, 0, 0); // 绘制 jm 实例的画布到 canvas }); // 创建一个下载链接元素 var downloadLink = document.createElement('a'); downloadLink.href = canvas.toDataURL('image/png'); // 将 canvas 转换为 base64 编码的 PNG 图片 downloadLink.download = 'mindmap.png'; // 设置下载的文件名 // 点击下载链接进行下载 downloadLink.click();
The text was updated successfully, but these errors were encountered:
https://hizzgdev.github.io/jsmind/example/2_features_cn.html
这个demo里有下载的功能,应该不需要你单独实现。你看看吧。
Sorry, something went wrong.
No branches or pull requests
var jm = new jsMind(options);
jm.show(mind);
// 找到 JSMind.js 实例所在的容器元素
var container = document.getElementById('jsmind_container'); // 根据实际情况替换为你的容器元素
The text was updated successfully, but these errors were encountered: