When the div is clicked, jump to the Vue method of the url defined in data
P粉426780515
P粉426780515 2023-10-23 15:46:15

I have this kind of object in my array:

{
  name: 'name1',
  url: 'http://url-1.tld'
},
{
  name: 'name2',
  url: 'http://url-2.tld'
}

When the div is clicked, I want to point the window.location.href to the url, but I can't seem to get the url from the data into my method.

<div v-for="person in persons" v-on:click="select($event)"></div>

select: function(event) {
  window.location.href( ??? )
}

Does anyone have any suggestions?

P粉426780515
P粉426780515

reply all(2)
Latest downloads
More>
web effects
Website source code
Website materials
Front end template
About us Disclaimer Sitemap
PHP Chinese website:Public welfare online PHP training,Help PHP learners grow quickly!