[英]Cant use @click="somefunction()" on a vs-dropdown
As the title says, I'm unable to use the @click function in a vs-dropdown正如标题所说,我无法在 vs-dropdown 中使用 @click 功能
<vs-dropdown>
<a href="#" @click="funct('/parameter')">Home</a>
<vs-dropdown-menu>
<vs-dropdown-item>
asdf
</vs-dropdown-item>
</vs-dropdown-menu>
</vs-dropdown>
<script>
export default {
data: () => ({}),
methods: {
funct(param) {
this.$routes.push(param)
}
}
}
</script>
As you can see, I should be redirected to '/parameter' but instead whenever I click it nothing happens, is there a way to work around this or force the dropdown to do what I want?正如您所看到的,我应该被重定向到“/参数”,但是每当我点击它时什么也没有发生,有没有办法解决这个问题或强制下拉菜单做我想要的?
It should be this.应该是这个。 $router .push(param) NOT this. $router .push(param)不是这个。 $routes .push(param) $routes .push(param)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.