Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This is not work in nuxt #18

Open
memclutter opened this issue Mar 21, 2020 · 1 comment
Open

This is not work in nuxt #18

memclutter opened this issue Mar 21, 2020 · 1 comment

Comments

@memclutter
Copy link

Expected Behavior

Work in nuxtjs

Actual Behavior

Doesn't work in nuxtjs, display error Cannot find module

Steps to Reproduce the Problem

@muthuridennis
Copy link

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants