@cloudbase/lowcode-builder 1.4.1 → 1.4.3
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.
|
@@ -94,16 +94,18 @@ async function buildWedaApp({ cals, subAppCalsList = [], dependencies = [], appK
|
|
|
94
94
|
// 尽早下载物料
|
|
95
95
|
await (0, net_1.downloadBrowserMaterial)(output === null || output === void 0 ? void 0 : output.path);
|
|
96
96
|
}
|
|
97
|
+
const { enablePageRoot } = (0, cals_1.parseVersion)(cals === null || cals === void 0 ? void 0 : cals.schemaVersion, dependencies);
|
|
97
98
|
const mpBuildContext = {
|
|
98
99
|
...buildContext,
|
|
99
100
|
projDir: (output === null || output === void 0 ? void 0 : output.path) || path_1.default.join(appBuildDir, 'mp'),
|
|
100
101
|
mainAppData: mainAppSerializeData,
|
|
101
102
|
processCssUnit: ([cals, ...subAppCalsList].find((cals) => {
|
|
102
|
-
const FEATURE_MAP = (0, cals_1.parseVersion)(cals.schemaVersion);
|
|
103
|
+
const FEATURE_MAP = (0, cals_1.parseVersion)(cals.schemaVersion, dependencies);
|
|
103
104
|
return !FEATURE_MAP.defaultDynamicCssUnit;
|
|
104
105
|
})
|
|
105
106
|
? 'px'
|
|
106
107
|
: 'rpx'),
|
|
108
|
+
enablePageRoot,
|
|
107
109
|
};
|
|
108
110
|
const result = await (0, index_1.generateWxMp)({
|
|
109
111
|
weapps: apps,
|
package/lib/builder/mp/wxml.js
CHANGED
|
@@ -32,13 +32,15 @@ function generateWxml(ctx, widgets, docTag, wxmlDataPrefix, usingComponents, com
|
|
|
32
32
|
].concat(createXml(widgets)),
|
|
33
33
|
};
|
|
34
34
|
if (ctx.isPage) {
|
|
35
|
+
const { enablePageRoot } = ctx;
|
|
35
36
|
const originElements = xmlJson.elements;
|
|
36
37
|
// 登录校验: 向其最外层包裹一层block
|
|
37
38
|
xmlJson.elements = [
|
|
38
39
|
{
|
|
39
40
|
type: 'element',
|
|
40
|
-
name: 'block',
|
|
41
|
+
name: enablePageRoot ? 'view' : 'block',
|
|
41
42
|
attributes: {
|
|
43
|
+
id: 'wd-page-root',
|
|
42
44
|
['wx:if']: '{{weDaHasLogin}}',
|
|
43
45
|
['data-weui-theme']: 'light',
|
|
44
46
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/lowcode-builder",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
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",
|
|
@@ -453,7 +453,7 @@
|
|
|
453
453
|
crossorigin="anonymous"
|
|
454
454
|
src="<%=
|
|
455
455
|
cdnEndpoints.cdngo
|
|
456
|
-
%>/lcap/lcap-resource-cdngo/-/release/_npm/@cloudbase/weda-cloud-sdk@1.0.
|
|
456
|
+
%>/lcap/lcap-resource-cdngo/-/release/_npm/@cloudbase/weda-cloud-sdk@1.0.27-alpha.0/dist/h5.browser.js"
|
|
457
457
|
></script>
|
|
458
458
|
<script>
|
|
459
459
|
// zxing polifill
|
|
@@ -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.2d3f3e4f3bfd356a2a85.bundle.js"
|
|
479
479
|
></script>
|
|
480
480
|
</body>
|
|
481
481
|
</html>
|
|
@@ -790,12 +790,13 @@ class UserWidget {
|
|
|
790
790
|
}
|
|
791
791
|
|
|
792
792
|
get custom() {
|
|
793
|
-
const
|
|
793
|
+
const widget = this._widget;
|
|
794
|
+
const instance = widget._getInstanceRef?.()?.current || {};
|
|
794
795
|
const userCustomMember = untracked(() => {
|
|
795
796
|
const { methods = {}, ...restInstance } = instance;
|
|
796
797
|
return new Proxy(
|
|
797
798
|
{
|
|
798
|
-
...
|
|
799
|
+
...widget._methods,
|
|
799
800
|
...restInstance,
|
|
800
801
|
...methods,
|
|
801
802
|
},
|
|
@@ -807,7 +808,7 @@ class UserWidget {
|
|
|
807
808
|
if (prop !== 'methods' && prop in instance) {
|
|
808
809
|
return instance[prop];
|
|
809
810
|
}
|
|
810
|
-
return
|
|
811
|
+
return widget?._methods?.[prop];
|
|
811
812
|
},
|
|
812
813
|
},
|
|
813
814
|
);
|
package/template/mp/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"dependencies": {<% if(importJSSDK) {%>
|
|
6
6
|
"@cloudbase/js-sdk": "2.5.6-beta.1",<% } %>
|
|
7
7
|
"@cloudbase/oauth": "0.1.1-alpha.5",
|
|
8
|
-
"@cloudbase/weda-client": "0.2.
|
|
8
|
+
"@cloudbase/weda-client": "0.2.47",
|
|
9
9
|
"@cloudbase/weda-cloud-sdk": "1.0.26",
|
|
10
10
|
"mobx": "^5.15.4",
|
|
11
11
|
"lodash.get": "^4.4.2",
|