如图:本人想把wap网站封装成微信小程序,封装之后发现分享到朋友圈和转发给朋友的相关功能不能使用。求index.ts 和 app.ts中相关转发与分享代码。(注意不是index.js 和 app.js代码,这个网上有,但是新建的小程序里面是 index.ts 和 app.ts 文件)
小程序不能分享和转发?求index.ts和app.ts中相关代码Can't share and forward mini programs? Find the relevant code in index.ts and app.ts
小程序不能分享和转发?求index.ts和app.ts中相关代码如图:本人想把wap网站封装成微信小程序,封装之后发现分享到朋友圈和转发给朋友的相关功能不能使用。求index.ts 和 app.ts中相关转发与分享代码。(注意不是index.js 和 app.js代码,这个网上有,但是新建的小程序里面是 index.ts 和 app.ts 文件)
As shown in the figure: I want to package the WAP website into a wechat applet. After packaging, I find that the related functions of sharing to the circle of friends and forwarding to friends cannot be used. Find index Ts and app TS related forwarding and sharing code. (note that it is not the code of index.js and app.js, which are available on the Internet, but the new applet contains the files of index.ts and app.ts)
回答:
1、新建一个page,不要改任何代码,然后点击分享。
index.ts里面加个转发的方法onShareAppMessage
onShareAppMessage
要在页面代码中配置onShareAppMessage
js VS ts