Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/10quality/vue-social-shares

Social sharer for Vue.
https://github.com/10quality/vue-social-shares

Last synced: 5 days ago
JSON representation

Social sharer for Vue.

Awesome Lists containing this project

README

        

# Social Shares Component (for [Vue](http://vuejs.org/))

[![GitHub version](https://badge.fury.io/gh/10quality%2Fvue-social-shares.svg)](https://badge.fury.io/gh/10quality%2Fvue-social-shares)
[![Bower version](https://badge.fury.io/bo/vue-social-shares.svg)](https://badge.fury.io/bo/vue-social-shares)

Social network sharing component for [Vue Js](http://vuejs.org/).

[Demo](http://codepen.io/amostajo/pen/ZOKyYR)

## Package index
- [Installation](#installation)
- [Usage](#usage)
- [Props](#props)
- [Custom binding](#custom-binding)
- [Events](#event)
- [Networks supported](#networks-supported)
- [License](#license)

## Installation

Several installation options are available:

- [Download the latest release](https://github.com/10quality/vue-social-shares/releases).
- Install with [Bower](http://bower.io): `bower install vue-social-shares`.

## Usage

Add the following resources for the component to function correctly.

```html

```

Add the component in your vue view.

```html



Share in facebook


Share in whatsapp

```

### Props

List of available props to use in component:

Prop | Data Type | Default | Description
-------------- | ---------- | --------- | -----------
`url` | String | current | URL to share.
`title` | String | | Sharing title (if available).
`description` | String | | Sharing description (if available).
`twitter-user` | String | | Twitter user (Only for twitter).

Usage example:

```html





```

```javascript
new Vue({
el: '#app',
data: {url:undefined},
});
```

### Custom binding

Instead of using child components to enable share functionality:

```html



Share in facebook

```

Click event binding can be applied instead, using component method `share`:

```html



Share in facebook

```

### Events

List of available events to use in component:

Event | Passes | Description
--------------------- | ----------------------------------------------- | -----------
`social_shares_click` | `network`: Selected network. `url`: shared url. | Triggered when a share network is clicked.

Usage example:

```javascript
new Vue({
el: '#app',
events: {
'social_shares_click': function(network, url) {
// TODO my code here
}
},
});
```

### Networks supported

List of available networks to use in component:

Network | Child component or key
-------------- | -----------------------
Facebook | `facebook`
Twitter | `twitter`
Google + | `googleplus`
Pinterest | `pinterest`
Reddit | `reddit`
LinkedIn | `linkedin`
Whatsapp | `whatsapp` (mobile only)

## License

Copyright (c) 2016 [10Quality](http://www.10quality.com/). Under MIT License.