<template>
    <social-share :config="shareConfig" v-if="info.id" />
</template>
<script>
import SocialShare from 'vue-social-share';
export default {
    name: 'share',
    props: {
        isBrand: {
            type: Boolean,
            default: false
        },
        info: {
            type: Object,
            default: () => {
                return {};
            }
        },
        local: {
            type: String,
            default: 'zh'
        }
    },
    components: {
        SocialShare
    },
    computed: {
        shareConfig() {
            return {
                url: 'https://www.imttech.cn/index/productDetail?id=' + this.info.id,
                title: this.info.nickname, // 标题，默认读取 document.title 或者 <meta name="title" content="share.js" />
                description: this.info.intro, // 描述, 默认读取head标签：<meta name="description" content="PHP弱类型的实现原理分析" />
                image: this.info.avatar, // 图片, 默认取网页中第一个img标签
                sites: ['qq', 'weibo', 'wechat', 'twitter'], // 启用的站点
                disabled: [], // 禁用的站点
                wechatQrcodeTitle: '微信扫一扫',
                wechatQrcodeHelper: '<p>微信里点“+”，扫一扫</p>'
            };
        }
    }
};
</script>
