vue-share-buttons
vue-share-buttons copied to clipboard
This is not work in nuxt
Expected Behavior
Work in nuxtjs
Actual Behavior
Doesn't work in nuxtjs, display error Cannot find module
Steps to Reproduce the Problem
You can write your code like so as to have it work with Nuxt
<template>
<div>
<twitter-button
:url="shareUrl"
:description="shareDescription"
/>
</div>
</template>
<script>
import VueShareButtons from 'vue-share-buttons/dist/vue-share-buttons.umd';
import 'vue-share-buttons/dist/vue-share-buttons.css';
import { defineComponent } from 'nuxt-composition-api';
export default defineComponent({
components: {
...VueShareButtons.components,
},
props: {
description: {
type: String,
default: ''
},
shareLink: {
type: String,
default: ''
},
},
setup(props){
return {
shareDescription: props.description,
shareUrl: props.shareLink,
}
}
})
</script>