vue点击按钮跳转页面并且获取到当前这条数据的id 在跳转到的页面接收这个id...

可以在按钮的点击事件处理函数中使用 router.push 方法来跳转页面,在跳转时将数据的 id 作为参数传递。然后在跳转到的页面中,可以使用路由对象的 $route.params 属性来获取这个 id。

示例代码如下:

<template>
  <div>
    <button @click="goToPage(item.id)">跳转button>
  div>
template>

<script>
export default {
  methods: {
    goToPage(id) {
      this.$router.push({ name: 'page', params: { id } })
    }
  }
}
script>

你可能感兴趣的:(vue.js,javascript,前端,html,ecmascript)