codecamp

mip-share 分享

提供页面内分享按钮功能,默认分享当前网址:

标题内容
类型通用
支持布局responsive,fixed-height,fill,container,fixed
所需脚本https://mipcache.bdstatic.com/static/v1.1/mip-share.js

示例

<!-- 通用分享 -->
<div class="mip-share-container">
    <mip-share 
        layout="fixed-height"
        height="158">
    </mip-share>
</div>

<!-- 通用分享 -->
<div class="mip-share-container">
    <mip-share 
        layout="fixed"
        width="200"
        height="158">
    </mip-share>
</div>

<!-- 通用分享 -->
<div class="mip-share-container">
    <mip-share 
        layout="responsive"
        width="414"
        height="158">
    </mip-share>
</div>

属性

url

说明:分享出去的网址
必选项:是
类型:字符串
取值范围:URL

title

说明:分享出去的标题
必选项:否
类型:字符串

content

说明:分享出去的内容
必选项:否
类型:字符串

icon

说明:分享出去的图标
必选项:否
类型:字符串
取值范围:URL

mip-link 跳转链接
mip-stats-tianrun 天润统计
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

MIP 帮助

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }