可参考 https://blog.csdn.net/fbqgdxw/article/details/126105936 然后把 onLoad,onShareAppMessage写在要分享的页面上,不要写在组件上
uniapp 微信小程序 设置 onShareAppMessage 标题,图片,path无效?[图片] Hbuilder编译完了后 分享一直 是默认的配置 但是方法进去了 是因为微信不支持hook了吗?
2022-11-18直接把这里的版本改下,我这样就OK了 大家可以试试看[图片]
regeneratorRuntime is not defined- 当前 Bug 的表现(可附上截图) - 预期表现 - 复现路径 - 提供一个最简复现 Demo 在一个页面中尝试使用async await函数却报出错误 部分代码如下: [代码]//page/test/test.js[代码][代码]var[代码] [代码]cloudio = require([代码][代码]'../../utils/cloudio.js'[代码][代码]);[代码] [代码]Page({[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面的初始数据[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]data: {[代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面加载[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onLoad: [代码][代码]function[代码] [代码](sence) {[代码] [代码] [代码][代码]//使用promise的版本[代码][代码] [代码][代码]// cloudio.addData('test', {[代码][代码] [代码][代码]// title: 'formvscode'[代码][代码] [代码][代码]// }).then(e => {[代码][代码] [代码][代码]// console.log('数据添加成功');[代码][代码] [代码][代码]// cloudio.updateData('test', e._id, {[代码][代码] [代码][代码]// content: 'this is a test',[代码][代码] [代码][代码]// user: 'lipenghui'[代码][代码] [代码][代码]// }).then(e => {[代码][代码] [代码][代码]// console.log('数据修改成功');[代码][代码] [代码][代码]// console.log(e.stats);[代码][代码] [代码][代码]// });[代码][代码] [代码][代码]// }).catch(err => console.log(err));[代码] [代码] [代码][代码]//使用async的版本[代码][代码] [代码][代码]var[代码] [代码]func=async [代码][代码]function[代码][代码](){[代码][代码] [代码][代码]var[代码] [代码]para1=await cloudio.addData([代码][代码]'test'[代码][代码],{[代码][代码] [代码][代码]title:[代码][代码]'使用async'[代码][代码] [代码][代码]});[代码][代码] [代码][代码]console.log([代码][代码]'数据添加成功'[代码][代码]);[代码][代码] [代码][代码]console.log([代码][代码]'para1: '[代码][代码]+para1);[代码] [代码] [代码][代码]var[代码] [代码]para2=await cloudio.updateData([代码][代码]'test'[代码][代码],para1._id,{[代码][代码] [代码][代码]content: [代码][代码]'this is a test'[代码][代码],[代码][代码] [代码][代码]user:[代码][代码]'lipenghui'[代码][代码],[代码][代码] [代码][代码]}); [代码] [代码] [代码][代码]console.log([代码][代码]'数据修改成功'[代码][代码]);[代码][代码] [代码][代码]console.log([代码][代码]'para1: '[代码][代码]+para2);[代码] [代码] [代码][代码]// return para2.toString+'这是return';[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]func();[代码][代码] [代码][代码]},[代码][代码]})[代码][代码]//util/cloudio.js[代码][代码]/**[代码][代码] [代码][代码]* 对云端进行操作[代码][代码] [代码][代码]*/[代码][代码]const db = wx.cloud.database();[代码] [代码]module.exports = {[代码] [代码] [代码][代码]//添加数据[代码][代码] [代码][代码]addData: [代码][代码]function[代码] [代码](_collection, content) {[代码][代码] [代码][代码]return[代码] [代码]new[代码] [代码]Promise((resolve, reject) => {[代码][代码] [代码][代码]db.collection(_collection).add({[代码][代码] [代码][代码]data: content[代码][代码] [代码][代码]}).then(e => resolve(e))[代码][代码] [代码][代码].[代码][代码]catch[代码][代码](err => reject(err));[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]// 更新数据[代码][代码] [代码][代码]updateData: [代码][代码]function[代码] [代码](_collection, _id, content) {[代码][代码] [代码][代码]return[代码] [代码]new[代码] [代码]Promise((resolve, reject) => {[代码][代码] [代码][代码]db.collection(_collection).doc(_id).update({[代码][代码] [代码][代码]data: content[代码][代码] [代码][代码]}).then(e => resolve(e))[代码][代码] [代码][代码].[代码][代码]catch[代码][代码](err => reject(err));[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码]}[代码] 报出的错误如下: [图片] 看之前的帖子引入一些文件之后好像错误更多,后来也不敢用了 这种错误现在有最终的解决办法吗?还是要等更新?
2020-09-18