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; }