1.1.1 • Published 7 years ago

@fastweb/wechat-share_common v1.1.1

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
7 years ago

微信分享 Build Status npm


微信分享到好友 朋友圈 qq

安装

ems:

cnpm i @fastweb/wechat-share -S

common:

cnpm i @fastweb/wechat-share_common -S

用法

  import WechatShare from '@fastweb/wechat-share';
  let shareData={
    "link": location.href,
    "title": "糖友春季饮食攻略",
    "desc": "让我们一品春天的味道",
    "content": "让我们一品春天的味道",
    "imageUrl": "http://static.91jkys.com/newactivity/dist/chunjiyinshi/img/share.jpg"
  };
  let wshare=new WechatShare(shareData,successFn,cancelFn);
  wshare.initShare();

方法

  • initShare 初始化分享

  • setShare(shareData,successFn,cancelFn) 重置分享内容及回调

shareData

{
  "link": location.href,//分享链接
  "title": "糖友春季饮食攻略",//标题
  "desc": "让我们一品春天的味道",//分享正文
  "content": "让我们一品春天的味道",//分享正文
  "imageUrl": "http://static.91jkys.com/newactivity/dist/chunjiyinshi/img/share.jpg"//分享图标
}