Vue-Router实现打开一个新页面跳转(类似谷歌)

 

 代码如下:

<template>
<div>
<button @click="goto('/andon/final/finalline01')">跳转</button>
</div>
</template>

<script>
export default {
name: "GoToPath",
data(){
return {}
},
methods: {
// 跳转函数(参数)
goto(val) {
// 跳转打开到新页面(类似谷歌)
const { href } = this.$router.resolve({
path: val
})
window.open(href, "_blank")
// 加入到指定路径
// this.$router.push({path: val})
}
},
mounted() {}
}
</script>

<style scoped>

</style>

相关文章:

  • 2021-09-17
  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-25
  • 2021-07-16
猜你喜欢
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
相关资源
相似解决方案