onShareAppMessage applet sharing function

Sometimes customers need to share the applet page, but the sharing function needs to be opened manually. At this time, the onShareAppMessage API needs to be used. This is at the same level as onLoad. If you click a button on the page to share, you can also Pass parameters through e

onLoad(){
    
    },
onShareAppMessage(e) {
    
    
    let item = e.dataset;
    return {
    
    
      title: '这里是标题',
      path: "/pages/index/main?Id=" + 1,//这个是页面路径以及带参数
      imageUrl: "xxx.png",//这个是分享出去后卡片里的图片
    };
  },

Guess you like

Origin blog.csdn.net/weixin_48772762/article/details/123329548