@cloudbase/framework-plugin-low-code 0.6.68 → 0.6.69
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/framework-plugin-low-code",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.69",
|
|
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",
|
|
@@ -169,17 +169,23 @@ export function createPage(
|
|
|
169
169
|
};
|
|
170
170
|
$page.invokeComponentMethod = ({ component, method, params }) => {
|
|
171
171
|
const components = lodashGet($page.componentMethods, component);
|
|
172
|
+
let componentInstance = undefined
|
|
172
173
|
if (Array.isArray(components)) {
|
|
173
|
-
|
|
174
|
+
if(components.length > 1){
|
|
175
|
+
throw new Error('调用方法失败:id为'+component+'的组件拥有多个实例')
|
|
176
|
+
}
|
|
177
|
+
componentInstance = components[0]
|
|
174
178
|
// components.forEach(component => {
|
|
175
179
|
// component[method](params);
|
|
176
180
|
// })
|
|
177
181
|
} else {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
+
componentInstance = components
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if(!componentInstance?.[method] || typeof componentInstance[method]!= 'function') {
|
|
186
|
+
throw new Error('调用方法失败:未找到id为'+component+'下的方法'+method)
|
|
182
187
|
}
|
|
188
|
+
return componentInstance[method](params);
|
|
183
189
|
};
|
|
184
190
|
this.$WEAPPS_PAGE = $page;
|
|
185
191
|
}
|
|
@@ -188,8 +188,8 @@ export function createWidgets(
|
|
|
188
188
|
w._getInstanceRef = () => null; // 默认初始值
|
|
189
189
|
Object.defineProperty(w, '_methods', {
|
|
190
190
|
get() {
|
|
191
|
-
const instance =
|
|
192
|
-
return instance?.current
|
|
191
|
+
const instance = this._getInstanceRef();
|
|
192
|
+
return instance?.current?.methods;
|
|
193
193
|
},
|
|
194
194
|
});
|
|
195
195
|
// 提供一个给 Node 挂载 API 的方式
|