name = 'www.baidu.com/'
<a :href="name">//如果这样子写的话会跳转到 localhost:8080/www.baidu.com/
解决方法:
<span @click="openUrl" id="url">{{data.url}}</span>
openUrl(){
window.location.href = 'https://'+this.data.url;
}
name = 'www.baidu.com/'
<a :href="name">//如果这样子写的话会跳转到 localhost:8080/www.baidu.com/
解决方法:
<span @click="openUrl" id="url">{{data.url}}</span>
openUrl(){
window.location.href = 'https://'+this.data.url;
}