diff --git a/index.html b/index.html
new file mode 100644
index 0000000..030a6ff
--- /dev/null
+++ b/index.html
@@ -0,0 +1,13 @@
+
+
+
+
a(超链接):
diff --git a/src/utils/common.js b/src/utils/common.js
index a1336ad..5208154 100644
--- a/src/utils/common.js
+++ b/src/utils/common.js
@@ -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" });
}
}
}
diff --git a/src/utils/forCode.js b/src/utils/forCode.js
index 7266442..319533e 100644
--- a/src/utils/forCode.js
+++ b/src/utils/forCode.js
@@ -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;
diff --git a/vite.config.js b/vite.config.js
new file mode 100644
index 0000000..bbaee64
--- /dev/null
+++ b/vite.config.js
@@ -0,0 +1,32 @@
+import { defineConfig } from "vite";
+import vue from "@vitejs/plugin-vue";
+import ViteRequireContext from "@originjs/vite-plugin-require-context";
+
+import path from "path";
+
+// https://vitejs.dev/config/
+export default defineConfig({
+ plugins: [
+ vue(),
+ ViteRequireContext(),
+ ],
+ resolve: {
+ alias: [
+ {
+ find: "@",
+ replacement: path.resolve(__dirname, "src"),
+ },
+ {
+ find: "vue",
+ replacement: "vue/dist/vue.esm-bundler.js"
+ }
+ ],
+ extensions: [".vue", ".js"],
+ },
+ server: {
+ fs: {
+ // 可以为项目根目录的上一级提供服务
+ allow: [".."],
+ },
+ },
+});
diff --git a/vue.config.js b/vue.config.js
index be0d138..7291afb 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -3,7 +3,8 @@ const path = require("path");
module.exports = {
css: { extract: false },
chainWebpack: (config) => {
- config.resolve.alias.set("vue$", "vue/dist/vue.esm.js");
+ // config.resolve.alias.set("vue$", "vue/dist/vue.esm.js");
+ // config.resolve.alias.set('vue', '@vue/compat/dist/vue.esm-browser.prod.js')
},
publicPath: process.env.PUBLIC_PATH,
|