Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

hinex/vue-simple-addthis-share

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple AddThis share component for Vue and Nuxt

release version npm version License: MIT dependences devDependences

Solves the problem with navigating through pages and URLs. Without extra shit. Just install and use. Also works with nuxt.

Install

npm install vue-simple-addthis-share --save

Usage

<script>
  import AddThis from 'vue-simple-addthis-share'
    
  export default {
    name: "AwesomeComponent",
    components: {
      AddThis,
    }
  }
</script>

If you have the same problem as this, just try to import plugin directly

import AddThis from 'vue-simple-addthis-share/src/AddThis.vue'

If you need use it on multiply pages

import Vue from 'vue';
import AddThis from 'vue-simple-addthis-share';

Vue.component('add-this', AddThis);

Template area:

<template>
  <AddThis publicId="ra-somehash" />
</template>

Custom props

You can pass AddThis attributes like a pros for title, media etc (AddThis props documentation).

<template>
  <AddThis 
    publicId="ra-somehash" 
    data-url="THE URL"
    data-title="THE TITLE"
    data-description="THE DESCRIPTION"
    data-media="THE IMAGE"
    :async="true" 
  />
</template>