euvl / v-clipboard

Simple and powerful clipboard plugin for Vue.js 2 and 3
MIT License
522 stars 39 forks source link

When using a button calling a method it returns always the same result #21

Closed xvendo closed 1 year ago

xvendo commented 4 years ago

`

<b-form-textarea readonly id="textarea-video" rows="3" max-rows="6" :value="getCurrentVideoCode(file)"

<b-button :id="'video-copy-no-autoplay' + file.id" v-clipboard="getCurrentVideoCode(file)" block variant="primary">
  Copy to clipboard
</b-button>`

`getCurrentVideoCode(file) {

        let videoHtml;

        videoHtml = '<video controls autoplay style="width: 100%; height: auto;">' +
        '<source src="' + file.url +
        '" type="video/mp4"> Your browser does not support HTML5 video.</video>';

        if (file.id == this.autoplay) {
          console.log('no autoplay')
          videoHtml = '<video controls style="width: 100%; height: auto;">' +
          '<source src="' + file.url +
          '" type="video/mp4"> Your browser does not support HTML5 video.</video>';
        }

        return videoHtml;

      }`

When the button got clicked it shows always the result including "autoplay". It seems that as soon as it gets the default result, it stays with it.

Thank you for that cool package!