I am looping on an element:
<li v-for="file in lesson.files">
<a @click="sourceReplace()" class="copied" :id="file.file_id" :src=file.src>
{{file.name}}
</a>
</li>
I need when clicking on this element to return the src of the clicked one to the variable which called links
methods: {
sourceReplace(){
var currentVideo = document.getElementById('current-video');
var currentSource = document.getElementById('current-source');
var link = this.src;
currentSource.setAttribute('src', link);
currentVideo.setAttribute('src', link);
alert(link)
currentVideo.load();
currentVideo.play();
}
},
links returns undefined