0.0.4 • Published 6 years ago

@bbtfe/share.js v0.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

分享组件接口文档

组件功能

二次分享设置的辅助工具,定制孕育、小时光、微信,手机QQ,QQ空间APP内的分享内容。

API

  1. setShareInfo

    设置分享信息,格式如下

    setShareInfo(object: ShareOptions);
    interface ShareOptions {
        title: string; // 分享标题
        content: string; // 分享描述
        url: string; // 分享链接
        imageUrl: string; // 分享图标
        timelineTitle?: string; // 朋友圈分享标题
    }
  2. showSharePanel

    显示分享面板,支持孕育、时光和QQ,微信不支持

Install

npm i @bbtfe/share

use

import share from '@bbtfe/share';
share.setShareInfo({
    title: '宝宝树小时光',
    content: '记录宝宝成长 珍藏家庭美好时光',
    url: `${window.location.origin}/app/lama/open.php`,
    imageUrl: `${window.location.protocol}//img01.babytreeimg.com/img/mg/dist/project/wetime/img/logo.png`,
    timelineTitle: '宝宝树小时光 - 记录宝宝成长 珍藏家庭美好时光', // 只在微信中生效,QQ中不支持
});
share.showSharePanel();
0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago