cloudcc-cli 0.9.5 → 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/package.json +1 -1
- package/src/builderPlugin.js +14 -17
package/README.md
CHANGED
package/package.json
CHANGED
package/src/builderPlugin.js
CHANGED
|
@@ -87,23 +87,20 @@ class Builder {
|
|
|
87
87
|
*/
|
|
88
88
|
getVueValue(buildFileName) {
|
|
89
89
|
let vueContent = fs.readFileSync(this.getVueContent(buildFileName), 'utf8');
|
|
90
|
-
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
let
|
|
99
|
-
|
|
100
|
-
let
|
|
101
|
-
//
|
|
102
|
-
let category = componentInfo.category
|
|
103
|
-
|
|
104
|
-
// 获取vueDate内容
|
|
105
|
-
let vueData = vueContent.split("data()")[1].split("return")[1].split("isLock:")[0] + "isLock:false,}";
|
|
106
|
-
|
|
90
|
+
let vueData = vueContent + ""
|
|
91
|
+
// 去除空格
|
|
92
|
+
// vueData = vueData.replace(/\ +/g, "")
|
|
93
|
+
// 去除换行
|
|
94
|
+
// vueData =vueData.replace(/[\r\n]/g, "");
|
|
95
|
+
vueData = vueData.split("data()")[1].split("isLock:")[0] + "isLock:false,};}";
|
|
96
|
+
vueData = "function data()" + vueData;
|
|
97
|
+
const data = eval(`(${vueData})`)()
|
|
98
|
+
let compName = data.componentInfo.component // 组件名字
|
|
99
|
+
vueData = JSON.stringify(data);
|
|
100
|
+
let bizType = data.componentInfo.bizType // 组件类型
|
|
101
|
+
let compDesc = data.componentInfo.compDesc // 组件描述
|
|
102
|
+
let category = data.componentInfo.category // 组件状态
|
|
103
|
+
console.log("vueData", vueData);
|
|
107
104
|
return { compName, vueContent, vueData, bizType, compDesc, category }
|
|
108
105
|
};
|
|
109
106
|
/**
|