0
Look at the code:
Notice that the application is working perfectly, by clicking on any address it is automatically directed to the Google page because of this method right below;
methods: {
showLink: function(bancodedado) {
window.open('http://www.google.com/?q=');
}
},
What I want to do is to only be directed to the Google page when it clicks on the record that has this specific email [email protected]
I tried that way, but I didn’t succeed:
methods: {
showLink: function(bancodedado) {
if (this.bancodedado.email == '[email protected]') {
window.open('http://www.google.com/?q=');
}
}
How could I make this implementation?
Try:
if (bancodedado.email === '[email protected]')
– NoobSaibot
It doesn’t work and still gives an error in the console saying that the email variable is undefined.
– wladyband
It does. See: https://jsfiddle.net/4pcLfd7L/6/
– NoobSaibot
Dude, it worked, I just copied and pasted the code, but I couldn’t find what was wrong before, thanks, thank you very much. :)
– wladyband
can post this solution as an answer. Thank you very much.
– wladyband
Because of the
this
, see the documentation - The Vue Instance– NoobSaibot