From 98aefc8fb5ae2255fa439443d161fc3481e9adaa Mon Sep 17 00:00:00 2001 From: Hex Date: Wed, 21 Apr 2021 15:03:47 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20html=20=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=90=8D=E4=B8=8D=E5=90=88=E6=B3=95=E7=9A=84=E9=9A=90?= =?UTF-8?q?=E6=82=A3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Node.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Node.vue b/src/components/Node.vue index 3b3ef46..50a093c 100755 --- a/src/components/Node.vue +++ b/src/components/Node.vue @@ -421,7 +421,7 @@ this.slots = this.calcSlots(component, this.nodeInfo.props) let type = this.nodeInfo.type // 如果有label(用户设置 || getbasenode设置 || 这里设置)保留,否则从component配置对象获取,否则用id - that.$set(that.info, 'label', that.info.label ? that.info.label : that.info.id.replace(type, (component && component.label) || type)) + that.$set(that.info, 'label', that.info.label ? that.info.label : that.info.id.replace(`ymm-${type.replace(/\//g, '-')}`, (component && component.label) || type)) that.$set(that.info, 'stack', (() => { // 设置过了 if (typeof that.info.stack === 'boolean') return that.info.stack From d1f6aef9d5ac0159376ae8182c77210ab28b3777 Mon Sep 17 00:00:00 2001 From: Hex Date: Wed, 21 Apr 2021 15:06:54 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20html=20=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=90=8D=E4=B8=8D=E5=90=88=E6=B3=95=E7=9A=84=E9=9A=90?= =?UTF-8?q?=E6=82=A3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/extend/Util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/extend/Util.js b/src/extend/Util.js index 21398b2..f5ace42 100755 --- a/src/extend/Util.js +++ b/src/extend/Util.js @@ -62,7 +62,7 @@ function getBaseNode (node) { if (!node.id) return useComponent(node.id) var info = { - id: node.name, + id: `ymm-${node.name.replace(/\//g, '-')}`, type: node.name, label: node.label, version: node.version, @@ -83,7 +83,7 @@ function getBaseNode (node) { top: '0px' }, node.style) } - var idCache = Object.keys(window.$_nodecomponents || {}).concat([node.name]) + var idCache = Object.keys(window.$_nodecomponents || {}).concat([info.id]) info = modifyNodeId(info, idCache) if (info.label) info.label = info.id.replace(node.id, info.label) // 给label添加id return info From 41283a101d310b38ce37f0c8ca5e6eb9e5cfa657 Mon Sep 17 00:00:00 2001 From: Hex Date: Wed, 21 Apr 2021 15:11:10 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20html=20=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=90=8D=E4=B8=8D=E5=90=88=E6=B3=95=E7=9A=84=E9=9A=90?= =?UTF-8?q?=E6=82=A3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/data/empty.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/data/empty.json b/src/assets/data/empty.json index 5149bcf..e69ff9b 100644 --- a/src/assets/data/empty.json +++ b/src/assets/data/empty.json @@ -11,7 +11,7 @@ }, "props": {}, "child": [{ - "id": "truck/richtextj0n4g65h", + "id": "ymm-truck-richtextj0n4g65h", "type": "truck/richtext", "label": "初次见面,请移除我", "visible": true, @@ -41,4 +41,4 @@ "path": "https://ymm-maliang.oss-cn-hangzhou.aliyuncs.com/truck/emptyContainer/1.0.2/index.js", "events": [], "label": "root" - } \ No newline at end of file + }