<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>

</style>
</head>
<body>
<div id="app">
<!-- 阻止a标签的跳转操作,而是由alertDialog来接管,也就不会跳转到baidu.com -->
<a href="http://www.baidu.com" @click.prevent="alertDialog">点击跳转到百度</a>
</div>
<script src="js/vue.js"></script>
<script>
var vue = new Vue({
el:"#app",
methods:{
alertDialog(event) {
alert('我是超级链接')
}
}
})
</script>
</body>
</html>

不会发生跳转:

vue事件修饰符:通过@click.prevent 阻止事件的默认行为_前端