vue3:数组道具通过路由器传递

时间:2021-05-03 09:25:17

标签: vue-router vuejs3

我有一个非常大的对象要从第一页传递到第二页。操作是点击echart对象上的图标,在detailView页面显示详情 这是我的“来自”页面 - tableData.value 包含要在详细页面中显示的大对象

  const router = useRouter();

  onclick: function (){
                     router.push({name:"DetailedView", params:{ title:"My Detail", tableData:tableData.value}});
                }

这是我的“to”页面——el-table是用来显示数据的

<template>
<label>Detailed Data View For {{title}}</label>
 <el-table
    :data="tableData"
    >
</el-table>    
</template>
<script lang="ts">
export default defineComponent({
        name: "DetailedView",
        props: [
         "title",
        
         "tableData"
          
         ],
        setup(props, { attrs, slots, emit }){
...

“title”道具已经成功传递,但“tableData”没有 你能告诉我是什么问题吗?

0 个答案:

没有答案
相关问题