1
0
mirror of https://github.com/sahadev/vue-component-creater-ui.git synced 2026-03-03 19:47:22 +08:00

update: 完全升级Vue3过程中的记录

This commit is contained in:
shangbin
2021-11-30 19:17:29 +08:00
parent 23bb007b5b
commit d6f575c503
26 changed files with 1032 additions and 463 deletions

View File

@@ -1,5 +1,5 @@
import isEqual from "lodash/isEqual";
import cryptoRandomString from "crypto-random-string";
import isEqual from "lodash-es/isEqual";
// import cryptoRandomString from "crypto-random-string";
export function getRawComponentKey(__rawVueInfo__) {
return Object.keys(__rawVueInfo__)[0];
@@ -50,7 +50,7 @@ export function ergodic(jsonObj) {
// 添加ID
if (!jsonObj["lc_id"]) {
jsonObj["lc_id"] = cryptoRandomString({ length: 10, type: "base64" });
// jsonObj["lc_id"] = cryptoRandomString({ length: 10, type: "base64" });
}
}
}

View File

@@ -1,7 +1,7 @@
import { isObject, isArray, getRawComponentKey } from '@/utils/common';
import presetAttribute from "../libs/presetAttribute";
const cryptoRandomString = require("crypto-random-string");
// const cryptoRandomString = require("crypto-random-string");
// 将预生成的ID替换否则当有两个组件挂在同一个树上时后一个会将前一个的属性覆盖
export function replaceRowID(codeObj, html) {
@@ -14,10 +14,7 @@ export function replaceRowID(codeObj, html) {
const element = obj[key];
if (key == "lc_id") {
const oldID = obj[key];
const newID = cryptoRandomString({
length: 10,
type: "base64",
});
const newID = 3333;
newHtml = newHtml.replace(oldID, newID);
obj[key] = newID;
} else if (isObject(element)) {
@@ -40,7 +37,7 @@ export function updateLinkTree(codeObj) {
window.tree = {};
}
if (!window.treeWithID) {
const innerObj = {};
let innerObj = {};
Object.defineProperty(window, 'treeWithID', {
get: function () {
return innerObj;