Coder Social home page Coder Social logo

weexshare's Introduction

WeexShare

weex的卡家分享组件

使用方法

import weexShare from '../src/components/weexShare.js' Vue.use(weexShare)

需要使用weex分享的页面直接把weexShare注入根组件

<weexShare :shareParams="shareData" :showShare="showShare" @shareCallBack="shareCallBack">

分享所需数据

shareData: {
	title: "", // 分享标题
	desc: "",  // 分享描述
	link: "",  // 分享链接
	imgUrl: "" // 分享图标
}

控制分享显示�

showShare

分享后的回调

shareCallBack: {
	platform, // 分享平台
	status    // 分享状态 '0' 成功
}

Tips:weexShare要放在根组件最下面 �以�确保渲染在最上层

shareCallBack (data) {
	// 分享成功
	if (data.status === '0') {
		const platformList = ['微信好友', '微信朋友圈', 'QQ好友', 'QQ空间', '新浪微博', '复制链接']
		const platform = platformList[data.platform]
		this.eventGa(weex.config.deviceId, '分享产品库成功', this.el, platform)
	}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.