【发布时间】:2020-08-09 09:29:00
【问题描述】:
我有 组件标签:
<template>
<a href="url">hi</a>
</template>
在其他页面上我显示标签并希望在 mouseClick 上调用我的方法
<tag @click.prevent="myFunction"></tag>
但我得到重定向到 url。 防止修饰符不起作用。如何解决这个问题?
更新:
同样的问题,但如果将 html 'A' 更改为 vue 路由器链接
<template>
<router-link :to="{ name: 'OtherPage'}"></router-link>
</template>
【问题讨论】:
标签: vue.js vuejs2 vue-component