@cloudbase/framework-plugin-low-code 0.6.45 → 0.6.48

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.
@@ -1 +1 @@
1
- {"version":3,"file":"wxml.d.ts","sourceRoot":"","sources":["../../../src/builder/mp/wxml.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,uBAAuB,EAEvB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAU3B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAkB/C,wBAAgB,YAAY,CAC1B,OAAO,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAA;CAAE,EACnD,MAAM,EAAE,MAAM,EACd,cAAc,KAAA,EACd,GAAG,EAAE,aAAa,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,EACxC,eAAe,KAAA,EACf,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,uBAAuB,EAAE,IAAI,KAAA,KAAK,IAAI,UAqV7D;AA4BD,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,eAAoB,UAS/B;AAuBD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAA;CAAE,EACnD,QAAQ,GAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAA;CAAO;;EAYlD"}
1
+ {"version":3,"file":"wxml.d.ts","sourceRoot":"","sources":["../../../src/builder/mp/wxml.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,uBAAuB,EAEvB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAU3B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAkB/C,wBAAgB,YAAY,CAC1B,OAAO,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAA;CAAE,EACnD,MAAM,EAAE,MAAM,EACd,cAAc,KAAA,EACd,GAAG,EAAE,aAAa,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,EACxC,eAAe,KAAA,EACf,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,uBAAuB,EAAE,IAAI,KAAA,KAAK,IAAI,UA4V7D;AA4BD,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,eAAoB,UAS/B;AAuBD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAA;CAAE,EACnD,QAAQ,GAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAA;CAAO;;EAYlD"}
@@ -105,8 +105,20 @@ function generateWxml(widgets, docTag, wxmlDataPrefix, ctx, usingComponents, nod
105
105
  if (path) {
106
106
  usingComponents[tagName] = path;
107
107
  }
108
+ let curForNodes = parentForNodes;
109
+ if (directives.waFor && directives.waFor.value) {
110
+ curForNodes = [...curForNodes, id];
111
+ }
112
+ const attrPrefix = `${wxmlDataPrefix.widgetProp}${id}${curForNodes
113
+ .map((forNodeId) => `[${wxmlDataPrefix.forIndex}${forNodeId}]`)
114
+ .join('')}.`;
115
+ const idAttr = curForNodes.length < 1
116
+ ? id
117
+ : `{{'${id}'${curForNodes
118
+ .map((forNodeId) => `+ '-' + ${wxmlDataPrefix.forIndex}${forNodeId}`)
119
+ .join('')}}}`;
108
120
  if (tagName === 'slot') {
109
- elements.push({
121
+ const slotNode = {
110
122
  type: 'element',
111
123
  name: tagName,
112
124
  attributes: {
@@ -117,21 +129,13 @@ function generateWxml(widgets, docTag, wxmlDataPrefix, ctx, usingComponents, nod
117
129
  elements: [],
118
130
  _order: xIndex || 0,
119
131
  _parent: null,
120
- });
132
+ };
133
+ if (directives.waIf && directives.waIf.value) {
134
+ slotNode.attributes['wx:if'] = getAttrBind(directives.waIf, `${attrPrefix}_waIf`);
135
+ }
136
+ elements.push(slotNode);
121
137
  continue;
122
138
  }
123
- let curForNodes = parentForNodes;
124
- if (directives.waFor && directives.waFor.value) {
125
- curForNodes = [...curForNodes, id];
126
- }
127
- const attrPrefix = `${wxmlDataPrefix.widgetProp}${id}${curForNodes
128
- .map((forNodeId) => `[${wxmlDataPrefix.forIndex}${forNodeId}]`)
129
- .join('')}.`;
130
- const idAttr = curForNodes.length < 1
131
- ? id
132
- : `{{'${id}'${curForNodes
133
- .map((forNodeId) => `+ '-' + ${wxmlDataPrefix.forIndex}${forNodeId}`)
134
- .join('')}}}`;
135
139
  const node = {
136
140
  type: 'element',
137
141
  name: tagName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/framework-plugin-low-code",
3
- "version": "0.6.45",
3
+ "version": "0.6.48",
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",
@@ -87,4 +87,4 @@
87
87
  "jest": "^26.0.1",
88
88
  "typescript": "^3.8.3"
89
89
  }
90
- }
90
+ }