1.0.0 • Published 6 years ago

share-react v1.0.0

Weekly downloads
18
License
MIT
Repository
github
Last release
6 years ago

share-react

Install npm

    npm install share-react

Install yarn

    yarn add share-react

Use

    import {
        Douban,
        Facebook,
        Google,
        Qq,
        Qzone,        
        Twitter,
        Weibo,
        Linkedin,
        TencentWB,        
        BaiduPostBar,
        Email,
    } from 'share-react';

    <Douban        
        style={{}}
        data={{}}
        isExitWindows={}
        className={}
         disable={}
        windowHeight={}
        windowWidth={}
        children={}
        otherProps={{}}
        customWindow={}        
        closeWindow={}
    >
        <Children /> // 为任意node 推荐使用这种方式定制内部组件
    </Douban>

props

属性类型默认值描述
isExitWindowsBooleantrue控制窗口状态 (开关)
classNameString随机窗口的名称
styleobject{}分享盒子的样式
disableBooleanfalse分享链接是否可以点击
windowHeightNumber400窗口的高度
windowWidthNumber600窗口的宽度
childrennode子节点 (建议使用 )
otherPropsobject其他自定义props属性

props method

方法类型描述
customWindowfun自定义窗口 arg为url
closeWindowfun关闭窗口发生的事件 arg为窗口实例

node props

组件props
Douban 豆瓣href: 链接 name: 名字 text: 文本 image: 图片
Facebook facebookurl: 链接
Google 谷歌url: 链接
Qq qq好友url: 链接 title: 标题 desc: 描述 source: '' summary: 摘要 pics: 图片
Qzone qq空间url: 链接 title: 标题 desc: 描述 summary: 摘要
Twitter 推特url: 链接 text: 文本 via: 经由
Weibo 微博url: 链接 text: 文本 pics: 图片 appkey:
Linkedin 点点url: 链接 title: 标题 summary: 摘要 source: armin:
TencentWB 腾讯微博url: 链接 title: 标题 pic: 图片 c: a:
BaiduPostBar 百度贴吧url: 链接 title: 标题
Email 邮件subject: 项目名称 body: 项目 内容
    data = {{
        url: ''
        ......
    }}

about wechat

    由于微信是生成二维码,为了不引入多余的库 可以使用如下库
    qrcode.react(https://github.com/zpao/qrcode.react)

License

MIT

Illustration

share-react 主要应用于一些中国应用的分享功能

参考于

share.js

react-share