From 14629be95912a7248b3b90abd3de0a1cf6515433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=92=AC=E8=BD=AE=E7=8C=AB?= <10928033@qq.com> Date: Fri, 21 May 2021 09:57:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=9C=A8=E7=BA=BF=E6=A8=A1?= =?UTF-8?q?=E6=8B=9F=E6=B7=BB=E5=8A=A0=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/CircuitEdit.vue | 66 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 4 deletions(-) diff --git a/src/views/CircuitEdit.vue b/src/views/CircuitEdit.vue index ec33d85..ecf2e30 100644 --- a/src/views/CircuitEdit.vue +++ b/src/views/CircuitEdit.vue @@ -5,12 +5,45 @@ + + + + + + + + + + + + + + + + + + + 预览 + + + 添加组件 + + 1.0版本 @@ -23,6 +56,10 @@ href="https://github.com/yaolunmao/vue-webtopo-svgeditor"> 帮助 + + 导出svg + + height="100%" + id="svgCanvas"> ", + props: ["svg_color"], + default_color: "#FF0000", + priview_img: "https://svg.yaolunmao.top/test.png" + }, + addSvgVisible: false, svgInfoData: [],//接口获取到的组件数据 shrink: true,//收缩状态 true收缩 false展开 svgLists: [],//svg列表 @@ -126,6 +173,18 @@ export default { } }, methods: { + showAddSvgModal () { + this.addSvgVisible = true; + }, + addSvgHandleOk () { + this.svgInfoData.push(this.testAddSvg); + this.addSvgVisible = false; + }, + exportSvg () { + var exportStr = document.querySelector("#svgCanvas").outerHTML; + console.log(exportStr); + alert("请使用F12查看consolo面板"); + }, MouseMove (e) { let _this = this; @@ -227,10 +286,9 @@ export default { } e.preventDefault(); //判断滚轮方向 -100是往上滑 100是下滑 - let svgZoom = e.deltaY <0 ? 0.1 : -0.1; - console.log(e.deltaY); + let svgZoom = e.deltaY < 0 ? 0.1 : -0.1; selectSvgInfo.size += svgZoom; - selectSvgInfo.size =parseFloat(selectSvgInfo.size.toFixed(1)); + selectSvgInfo.size = parseFloat(selectSvgInfo.size.toFixed(1)); if (selectSvgInfo.size < 1) { selectSvgInfo.size = 1; }