企业微信朋友圈分享
查看源码属性参考
| 注册名 | data-controller="share-moment" |
|---|---|
| Targets | |
| Values | |
| Outlets |
结构示意:该组件依赖外部运行时或会在挂载时产生副作用,
下方用
<template> 展示真实 DOM 结构(不会被 Stimulus 连接)。
在具备条件的环境中去掉 <template> 包裹即可运行。
分享到企业微信客户朋友圈:shareImage() 把 text value 与 images value(图片 URL 数组)组装成 attachments 调用 wx.invoke(“shareToExternalMoments”)。
<button data-controller="share-moment" data-share-moment-text-value="活动说明"
data-share-moment-images-value='["https://example.com/a.png"]'
data-action="click->share-moment#shareImage">分享到朋友圈</button>
源码 shareImage() 读取了 this.debugValue,但类里没有声明 debug value;如需 debug 弹窗要补上 static values。