vue el-button 跳转链接的方法
<el-button>点击后如何跳转指定url链接
更新时间:2023年04月13日 10:20:33 作者:Hemist
这篇文章主要介绍了<el-button>点击后如何跳转指定url链接问题,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
−
目录
<el-button>点击后跳转指定url链接
Vue + elementUI 的项目前端遇到了这样一个问题:
如何实现点击 button 后,直接跳转到指定的 web_url ?
这里提供一个解决方案,仅供学习和参考。
|
1 2 3 4 5 |
|
其中:
- ① this.webUrl 是 web url 链接;
- ② target=“_blank” 规定在新的页面中打开链接;
- ③ style=“text-decoration: none” 去除超链接的下划线。
用el-button跳转页面
1.el-button绑定点击事件
|
1 |
|
2.在methods内写入方法
注:data即使不需要传数据,也必须return,否则会报错
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|