@cloudbase/lowcode-builder 0.1.20 → 0.1.23
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/lib/builder/config/index.js +1 -7
- package/lib/builder/h5/copy.js +1 -5
- package/lib/builder/h5/material.js +1 -5
- package/lib/builder/mp/index.js +1 -5
- package/lib/builder/mp/materials.js +1 -5
- package/lib/builder/mp/mixMode.js +1 -5
- package/lib/builder/mp/mp_config.js +3 -7
- package/lib/builder/mp/plugin.js +1 -5
- package/lib/builder/mp/util.d.ts +3 -3
- package/lib/builder/mp/util.js +26 -7
- package/lib/builder/util/generateFiles.js +1 -5
- package/lib/builder/util/index.js +1 -5
- package/lib/builder/util/mp.js +1 -5
- package/lib/builder/util/net.js +1 -5
- package/lib/builder/util/process.d.ts +0 -1
- package/lib/index.js +1 -5
- package/package.json +4 -2
- package/template/mp/common/weapp-component.js +7 -3
- package/template/mp/package.json +1 -1
- package/template/package.json +1 -1
- package/template/src/index.jsx +9 -0
- package/lib/builder.web.js +0 -79
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
|
@@ -43,13 +39,11 @@ exports.materialsDirName = 'materials'; // materials diretory of current project
|
|
|
43
39
|
* src/template的代码,在IDE编辑器插件中构建builder
|
|
44
40
|
* 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488®ion=ap-shanghai&path=%252Flcap-builder%252F
|
|
45
41
|
*/
|
|
46
|
-
// export const builderTemplateURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/template.zip';
|
|
47
42
|
exports.builderTemplateURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/template_20220616.zip';
|
|
48
43
|
/**
|
|
49
44
|
* miniprogram的代码,IDE插件后续会提供端功能
|
|
50
45
|
* 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488®ion=ap-shanghai&path=%252Flcap-builder%252F
|
|
51
46
|
*/
|
|
52
|
-
// export const miniprogramURL = 'https://cos-1252394733.cos.ap-nanjing.myqcloud.com/miniprogram_npm.zip';
|
|
53
47
|
exports.miniprogramURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/miniprogram_npm_20220616.zip';
|
|
54
48
|
/**
|
|
55
49
|
* miniprogram_npm存放目录。IDE插件builder用到
|
package/lib/builder/h5/copy.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
package/lib/builder/mp/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
|
@@ -109,8 +105,8 @@ function generateMpConfig(weapps, ctx) {
|
|
|
109
105
|
appConfig.plugins = plugins;
|
|
110
106
|
}
|
|
111
107
|
miniprogramPlugins.forEach((plugin) => {
|
|
112
|
-
var _a;
|
|
113
|
-
if (!((_a = appConfig === null ||
|
|
108
|
+
var _a, _b;
|
|
109
|
+
if (!((_b = (_a = appConfig) === null || _a === void 0 ? void 0 : _a.plugins) === null || _b === void 0 ? void 0 : _b[plugin.name])) {
|
|
114
110
|
(0, lodash_1.set)(appConfig, `plugins.${plugin.name}`, {
|
|
115
111
|
version: plugin.version,
|
|
116
112
|
provider: plugin.pluginAppId,
|
package/lib/builder/mp/plugin.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
package/lib/builder/mp/util.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IDynamicValue, IWeAppComponentInstance } from '@cloudbase/lowcode-generator/lib/weapps-core';
|
|
1
|
+
import { IDynamicValue, IWeAppComponentInstance, ICompositedComponent } from '@cloudbase/lowcode-generator/lib/weapps-core';
|
|
2
2
|
import { IBuildContext } from './BuildContext';
|
|
3
|
-
export declare function extractWidgetProps(props: Required<IWeAppComponentInstance>['xProps']): any;
|
|
3
|
+
export declare function extractWidgetProps(props: Required<IWeAppComponentInstance>['xProps'], compInfo: ICompositedComponent): any;
|
|
4
4
|
export declare function generatedDynamicData(data: {
|
|
5
5
|
[key: string]: IDynamicValue;
|
|
6
|
-
}): {
|
|
6
|
+
}, compInfo?: ICompositedComponent): {
|
|
7
7
|
staticProps: {};
|
|
8
8
|
boundProps: {};
|
|
9
9
|
};
|
package/lib/builder/mp/util.js
CHANGED
|
@@ -5,7 +5,7 @@ const weapps_core_1 = require("@cloudbase/lowcode-generator/lib/weapps-core");
|
|
|
5
5
|
const weapp_1 = require("@cloudbase/lowcode-generator/lib/generator/util/weapp");
|
|
6
6
|
const wxml_1 = require("./wxml");
|
|
7
7
|
const mp_1 = require("@cloudbase/lowcode-generator/lib/generator/config/mp");
|
|
8
|
-
function extractWidgetProps(props) {
|
|
8
|
+
function extractWidgetProps(props, compInfo) {
|
|
9
9
|
const { classList } = props;
|
|
10
10
|
const staticProps = {
|
|
11
11
|
style: (0, weapps_core_1.toCssStyle)(props.commonStyle, {
|
|
@@ -15,19 +15,31 @@ function extractWidgetProps(props) {
|
|
|
15
15
|
classList: classList || [],
|
|
16
16
|
};
|
|
17
17
|
const { data = {} } = props;
|
|
18
|
-
Object.assign(staticProps, generatedDynamicData(data).staticProps);
|
|
18
|
+
Object.assign(staticProps, generatedDynamicData(data, compInfo).staticProps);
|
|
19
19
|
return staticProps;
|
|
20
20
|
}
|
|
21
21
|
exports.extractWidgetProps = extractWidgetProps;
|
|
22
|
-
function generatedDynamicData(data) {
|
|
22
|
+
function generatedDynamicData(data, compInfo) {
|
|
23
23
|
const staticProps = {};
|
|
24
24
|
const boundProps = {};
|
|
25
|
-
for (const key
|
|
25
|
+
for (const key of Object.keys(data)) {
|
|
26
26
|
if (mp_1.builtinWigetProps.indexOf(key) > -1)
|
|
27
27
|
continue;
|
|
28
28
|
const { type, value } = data[key];
|
|
29
29
|
if (!type || type === 'static') {
|
|
30
30
|
staticProps[key] = value;
|
|
31
|
+
if (value === undefined) {
|
|
32
|
+
/* 为了避免绑定undefined的时候,与组件properties类型声明不匹配
|
|
33
|
+
在小程序基础库2.18后会爆warning
|
|
34
|
+
所以提前给他准备空值
|
|
35
|
+
*/
|
|
36
|
+
if ((compInfo === null || compInfo === void 0 ? void 0 : compInfo.dataForm[key]) && mp_1.jsonSchemaType2jsClass[compInfo.dataForm[key].type]) {
|
|
37
|
+
const globalNamespace = typeof globalThis === 'undefined' ? global : globalThis;
|
|
38
|
+
const constructorName = mp_1.jsonSchemaType2jsClass[compInfo.dataForm[key].type];
|
|
39
|
+
const defaultValue = globalNamespace[constructorName]();
|
|
40
|
+
staticProps[key] = defaultValue;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
31
43
|
}
|
|
32
44
|
else {
|
|
33
45
|
boundProps[key] = generateDataBind(data[key]);
|
|
@@ -100,7 +112,12 @@ function createWidgetProps(widgets, ctx) {
|
|
|
100
112
|
console.error('Component lib not found', xComponent);
|
|
101
113
|
return;
|
|
102
114
|
}
|
|
103
|
-
|
|
115
|
+
const widegetComp = materialLib === null || materialLib === void 0 ? void 0 : materialLib.components.find((comp) => comp.name === xComponent.name);
|
|
116
|
+
if (!widegetComp) {
|
|
117
|
+
console.error('Component not found in lib', widegetComp);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
widgetProps[id] = extractWidgetProps(xProps, widegetComp);
|
|
104
121
|
widgetProps[id]._parentId = parentId;
|
|
105
122
|
widgetProps[id]._order = widget.xIndex;
|
|
106
123
|
widgetProps[id].widgetType = xComponent.moduleName + ':' + xComponent.name;
|
|
@@ -178,7 +195,8 @@ function createEventHanlders(widgets, componentApi, ctx) {
|
|
|
178
195
|
// 如果是数据容器,则生成一个onDataChange事件处理
|
|
179
196
|
if ((_c = compProto === null || compProto === void 0 ? void 0 : compProto.compConfig) === null || _c === void 0 ? void 0 : _c.isDataContainer) {
|
|
180
197
|
const customName = (0, wxml_1.getMpEventHanlderName)(id, 'onDataChange', {});
|
|
181
|
-
eventHanlders[customName] = [
|
|
198
|
+
eventHanlders[customName] = [
|
|
199
|
+
{
|
|
182
200
|
key: '',
|
|
183
201
|
handler: `({event})=>{
|
|
184
202
|
app.utils.set(context, '${id}.data', event?.detail?.data);
|
|
@@ -186,7 +204,8 @@ function createEventHanlders(widgets, componentApi, ctx) {
|
|
|
186
204
|
handlerModule: weapps_core_1.ActionType.Platform,
|
|
187
205
|
data: {},
|
|
188
206
|
boundData: {},
|
|
189
|
-
}
|
|
207
|
+
},
|
|
208
|
+
];
|
|
190
209
|
}
|
|
191
210
|
});
|
|
192
211
|
return eventHanlders;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
package/lib/builder/util/mp.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
package/lib/builder/util/net.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
package/lib/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/lowcode-builder",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"description": "云开发 Tencent CloudBase Framework Low Code Plugin,将低码配置生成完整项目并一键部署云开发资源。",
|
|
5
5
|
"author": "yhsunshining@gmail.com",
|
|
6
6
|
"homepage": "https://github.com/TencentCloudBase/cloudbase-framework#readme",
|
|
@@ -8,11 +8,13 @@
|
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"types": "lib/index.d.ts",
|
|
10
10
|
"directories": {
|
|
11
|
+
"dist": "dist",
|
|
11
12
|
"lib": "lib",
|
|
12
13
|
"test": "__tests__"
|
|
13
14
|
},
|
|
14
15
|
"files": [
|
|
15
16
|
"lib",
|
|
17
|
+
"dist",
|
|
16
18
|
"template"
|
|
17
19
|
],
|
|
18
20
|
"publishConfig": {
|
|
@@ -84,4 +86,4 @@
|
|
|
84
86
|
"webpack-dev-server": "^4.7.3",
|
|
85
87
|
"worker-loader": "^3.0.8"
|
|
86
88
|
}
|
|
87
|
-
}
|
|
89
|
+
}
|
|
@@ -5,7 +5,7 @@ import mergeRenderer from './merge-renderer'
|
|
|
5
5
|
import { runWatchers } from './watch'
|
|
6
6
|
import sdk from './weapp-sdk'
|
|
7
7
|
import lodashGet from 'lodash.get';
|
|
8
|
-
|
|
8
|
+
import { resolveWidgetData } from './widget';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Lowcodes of all components
|
|
@@ -13,7 +13,11 @@ import lodashGet from 'lodash.get';
|
|
|
13
13
|
export const compLowcodes = {}
|
|
14
14
|
|
|
15
15
|
export function createComponent(key, behaviors, properties, events, handler, dataBinds, evtListeners, widgetProps, index, lifeCycle, stateFn, computedFuncs, config, libCommonRes, undefined, context) {
|
|
16
|
-
|
|
16
|
+
const initData = {};
|
|
17
|
+
for (const id in widgetProps) {
|
|
18
|
+
const props = widgetProps[id]
|
|
19
|
+
initData['' + id] = resolveWidgetData(props)
|
|
20
|
+
}
|
|
17
21
|
compLowcodes[key] = {
|
|
18
22
|
index,
|
|
19
23
|
stateFn,
|
|
@@ -45,7 +49,7 @@ export function createComponent(key, behaviors, properties, events, handler, dat
|
|
|
45
49
|
...properties,
|
|
46
50
|
},
|
|
47
51
|
|
|
48
|
-
data:
|
|
52
|
+
data: initData,
|
|
49
53
|
|
|
50
54
|
lifetimes: {
|
|
51
55
|
created() {
|
package/template/mp/package.json
CHANGED
package/template/package.json
CHANGED
package/template/src/index.jsx
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 当本应用是乾坤子应用是,publicPath需要设置为子应用的相对路径
|
|
3
|
+
* 这个变量时序重要需要先初始化
|
|
4
|
+
*/
|
|
5
|
+
if (window.__POWERED_BY_QIANKUN__) {
|
|
6
|
+
__webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
import * as React from 'react'
|
|
2
11
|
import * as ReactDOM from 'react-dom'
|
|
3
12
|
import { setConfig } from './datasources/index'
|