SHARE
TWEET

Untitled

a guest Oct 12th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export default {
  2.   props:  [ 'object', 'url', 'id' ],
  3.  
  4.   watch: {
  5.     'object' (value) {
  6.       this.on = true
  7.     },
  8.     'on' (value) {
  9.  
  10.       if (value) {
  11.         this.$store.commit('modalOn')
  12.         console.log(this.$refs.copyButton)
  13.         /*
  14.         this.$refs.copyButton.addEventListener('click', this.copyClick, false)
  15.         this.$refs.copyButton.addEventListener('copy', this.copy, false)
  16.         */
  17.  
  18.       } else {
  19.         this.$store.commit('modalOff')
  20.       }
  21.  
  22.     },
  23.   },
  24.  
  25.   methods: {
  26.     copyClick (event) {
  27.       event.target.dispatchEvent(this.clipEvent = new ClipboardEvent('copy'))
  28.     },
  29.     copy (event) {
  30.       event.clipboardData.setData("text/plain", "pweorjwpeorj")
  31.     },
  32.   },
  33.  
  34.   destroyed () {
  35.     if (process.browser && this.$refs.copyButton) {
  36.       this.copyButton.removeEventListener('click', this.copyClick, false)
  37.       this.copyButton.removeEventListener('copy', this.copy, false)
  38.     }
  39.   },
  40.  
  41.  
  42.   data () {
  43.     return {
  44.       clipEvent: false,
  45.       copyButton: false,
  46.       on: false,
  47.       event: false,
  48.     }
  49.   }
  50. }
RAW Paste Data
Top