From 1464cbe4f9bde148202f46cfd680dfdc8baf172f Mon Sep 17 00:00:00 2001 From: Shangbin Date: Sat, 23 Oct 2021 20:58:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=A2=AB=E5=85=B6=E5=AE=83?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=BC=95=E7=94=A8=E4=B8=8D=E8=83=BD=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E8=A7=A3=E6=9E=90=E7=BB=84=E4=BB=B6=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/components-v2/VCC.vue | 5 +++++ src/libs/main-panel.js | 1 - src/main.js | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 7b9f78a..cb0abb0 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "serve": "vue-cli-service serve --open --port 8008", "build:release": "vue-cli-service build", "build": "vue-cli-service build --report --target lib --name vcc './src/components-v2/VCC.vue' && node ./src/script/distClear.js", + "build:win": "vue-cli-service build --report --target lib --name vcc ./src/components-v2/VCC.vue && node ./src/script/distClear.js", "compileAndbuild:dev": "npm run compileComponent && vue-cli-service build", "lint": "vue-cli-service lint", "build:prod": "vue-cli-service build --mode production", diff --git a/src/components-v2/VCC.vue b/src/components-v2/VCC.vue index 6378a5c..30714e7 100644 --- a/src/components-v2/VCC.vue +++ b/src/components-v2/VCC.vue @@ -96,6 +96,11 @@ export default { this.$refs['attributeInput'].onHide(); } }, + initCodeEntity(newVal) { + if (newVal) { + this.mainPanelProvider.render(newVal); + } + } }, computed: { }, diff --git a/src/libs/main-panel.js b/src/libs/main-panel.js index 26280e5..cdf7091 100644 --- a/src/libs/main-panel.js +++ b/src/libs/main-panel.js @@ -6,7 +6,6 @@ * */ import { parseComponent } from 'vue-template-compiler/browser'; -import Vue from 'vue'; import { merge, insertPresetAttribute, getSplitTag, replaceRowID, updateLinkTree, findCodeElemNode, findRawVueInfo, removeAllID } from "@/utils/forCode"; import { getRawComponentContent, getRawComponentKey, isObject } from '@/utils/common'; import { createNewCodeGenerator } from "@/libs/code-generator-factory"; diff --git a/src/main.js b/src/main.js index d096f8f..d627a90 100644 --- a/src/main.js +++ b/src/main.js @@ -11,6 +11,9 @@ import "./assets/nestable.css" Vue.use(ElementUI); Vue.use(AntdUI); +// 内部需要同样配置的全局Vue +self.Vue = Vue; + new Vue({ el: "#app", render: (h) => h(APP),