UNPKG

vue-share-it

Version:

A Vue.js component for sharing links to social networks

23 lines (19 loc) 894 B
import shareIt from './components/shareIt.vue'; import shareButton from './components/shareButton.vue'; import { library } from '@fortawesome/fontawesome-svg-core'; import { faXTwitter, faFacebookF, faWhatsapp, faLinkedin, faRedditAlien } from '@fortawesome/free-brands-svg-icons'; import { faEnvelope } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; const shareItPlugin = { install (Vue, options) { library.add(faXTwitter, faFacebookF, faWhatsapp, faLinkedin, faRedditAlien, faEnvelope); Vue.component('font-awesome-icon', FontAwesomeIcon); Vue.component('share-it', shareIt); Vue.component('share-button', shareButton); } }; export default shareItPlugin; // Automatic installation if Vue has been added to the global scope. if (typeof window !== 'undefined' && window.Vue) { window.Vue.use(shareItPlugin) }