调用element.setData()和element.callMethods()提示没有这个方法

发布于 5 年前作者 xia912640 次浏览最后编辑 5 年前来自 ask

https://developers.weixin.qq.com/miniprogram/dev/devtools/auto/element.html

源码如下:(获的element是小程序中自定义的组件user-card)

page = await miniProgram.reLaunch('/pages/mine/index');
await page.waitFor(2000);
const element = await page.$('user-card');
await element.setData({id: 1345});
await element.callMethod('getExplicitUid');

0 回复
暂无回复