@cloudbase/lowcode-builder 1.3.8 → 1.3.10
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/mp/wxml.js +11 -1
- package/package.json +3 -3
- package/template/html/index.html.ejs +1 -1
- package/template/mp/common/data-patch.js +6 -2
- package/template/mp/common/util.js +3 -1
- package/template/mp/common/weapp-page.js +4 -6
- package/template/mp/common/widget.js +647 -631
- package/template/mp/package.json +1 -1
package/lib/builder/mp/wxml.js
CHANGED
|
@@ -63,7 +63,17 @@ function generateWxml(ctx, widgets, docTag, wxmlDataPrefix, usingComponents, com
|
|
|
63
63
|
// slot prop
|
|
64
64
|
const slotNodes = createXml(properties, parent, parentForNodes);
|
|
65
65
|
slotNodes.forEach((node) => {
|
|
66
|
-
node.
|
|
66
|
+
if (node.name == 'block') {
|
|
67
|
+
/**
|
|
68
|
+
* block 组件上的 slot 属性不生效,只能透传到下面的组件
|
|
69
|
+
*/
|
|
70
|
+
(node.elements || []).forEach((node) => {
|
|
71
|
+
node.attributes.slot = id;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
node.attributes.slot = id;
|
|
76
|
+
}
|
|
67
77
|
elements === null || elements === void 0 ? void 0 : elements.push(node);
|
|
68
78
|
});
|
|
69
79
|
if (parent) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/lowcode-builder",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.10",
|
|
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",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"url": "https://github.com/TencentCloudBase/cloudbase-framework/issues"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@cloudbase/cals": "^0.5.
|
|
42
|
-
"@cloudbase/lowcode-generator": "^1.3.
|
|
41
|
+
"@cloudbase/cals": "^0.5.11",
|
|
42
|
+
"@cloudbase/lowcode-generator": "^1.3.6",
|
|
43
43
|
"axios": "^0.21.0",
|
|
44
44
|
"browserfs": "^1.4.3",
|
|
45
45
|
"browserify-zlib": "^0.2.0",
|
|
@@ -475,7 +475,7 @@
|
|
|
475
475
|
crossorigin
|
|
476
476
|
src="<%=
|
|
477
477
|
cdnEndpoints.cdngo
|
|
478
|
-
%>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.
|
|
478
|
+
%>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.2895317effcdaa894b2d.bundle.js"
|
|
479
479
|
></script>
|
|
480
480
|
</body>
|
|
481
481
|
</html>
|
|
@@ -15,12 +15,16 @@ export function getDatapatch(base, pendingData) {
|
|
|
15
15
|
|
|
16
16
|
function patchProp(baseWidget, pendingWidget, patch, prefixes) {
|
|
17
17
|
if (Array.isArray(pendingWidget)) {
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* 数组长度发生变化,更新整个数组
|
|
20
|
+
* 通过 array[0].xxx 进行更新,id 不会更新,疑似 mp 实现 bug
|
|
21
|
+
*/
|
|
22
|
+
if (pendingWidget.length != baseWidget.length) {
|
|
19
23
|
patch[prefixes] = pendingWidget
|
|
20
24
|
return
|
|
21
25
|
}
|
|
22
26
|
for (let i = 0; i < pendingWidget.length; i++) {
|
|
23
|
-
if (!baseWidget[i]) {
|
|
27
|
+
if (!baseWidget[i]) {
|
|
24
28
|
patch[prefixes + '[' + i + ']'] = pendingWidget[i]
|
|
25
29
|
} else {
|
|
26
30
|
patchProp(baseWidget[i], pendingWidget[i], patch, prefixes + '[' + i + ']')
|
|
@@ -371,9 +371,11 @@ export async function checkAuth(app, appId, $page) {
|
|
|
371
371
|
try {
|
|
372
372
|
if (isAnonymousUser) {
|
|
373
373
|
redirectToLogin($page);
|
|
374
|
+
return false
|
|
374
375
|
}
|
|
375
376
|
} catch (e) {
|
|
376
377
|
redirectToLogin($page);
|
|
378
|
+
return false
|
|
377
379
|
}
|
|
378
380
|
}
|
|
379
381
|
return isAccess;
|
|
@@ -455,7 +457,7 @@ async function getGeneralOptions(optionName) {
|
|
|
455
457
|
data: {
|
|
456
458
|
PageSize: 1,
|
|
457
459
|
PageIndex: 1,
|
|
458
|
-
|
|
460
|
+
OptNameList: [optionName],
|
|
459
461
|
},
|
|
460
462
|
});
|
|
461
463
|
}
|
|
@@ -146,17 +146,15 @@ export function createPage(
|
|
|
146
146
|
app.__internal__.activePage = $page;
|
|
147
147
|
this._pageActive = true;
|
|
148
148
|
|
|
149
|
-
const hook = lifecycle.onShow || lifecycle.onPageShow;
|
|
150
|
-
hook?.call?.($page);
|
|
151
|
-
|
|
152
149
|
// 权限检查
|
|
153
150
|
if (await checkAuth(app, app.id, $page)) {
|
|
154
151
|
this.setData({
|
|
155
152
|
weDaHasLogin: true,
|
|
156
153
|
});
|
|
154
|
+
const hook = lifecycle.onShow || lifecycle.onPageShow;
|
|
155
|
+
hook?.call?.($page);
|
|
156
|
+
this.invokeEventHandler(id, 'show');
|
|
157
157
|
}
|
|
158
|
-
|
|
159
|
-
this.invokeEventHandler(id, 'show');
|
|
160
158
|
},
|
|
161
159
|
onHide() {
|
|
162
160
|
const $page = this._getInstance();
|
|
@@ -214,7 +212,7 @@ export function createPage(
|
|
|
214
212
|
componentInstance = components;
|
|
215
213
|
}
|
|
216
214
|
|
|
217
|
-
const currentInstanceRef = componentInstance?._getInstanceRef()?.current;
|
|
215
|
+
const currentInstanceRef = componentInstance?._getInstanceRef()?.current || {};
|
|
218
216
|
const { methods = {}, ...restInstanceRef } = currentInstanceRef;
|
|
219
217
|
|
|
220
218
|
const readonlyMap = {
|