mo49
7/22/2019 - 6:59 AM

CopyUrlButton.vue

// https://github.com/webcore-it/nuxt-clipboard2

<template>
  <button @click="copyUrl()"></button>
</template>

<script>
export default {
  computed: {
    absolutePath () {
      return `${process.env.siteUrl}${this.$router.history.base}${this.$route.path}`
    },
  },
  methods: {
    copyUrl() {
      this.$copyText(this.absolutePath)
    },
  }
}
</script>