You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

45 lines
1011 B

<template>
<div>
<ul>
<li v-for="m in messageList" :key="m.id">
<!-- to的普通写法-->
<!-- <router-link :to="`/home/message/detail/${m.id}/${m.title}`">{{ m.title }}</router-link>-->
<!-- to的对象写法-->
<router-link :to="{
// path: '/home/message/detail',
name: 'xiangqing',
params: {
id: m.id,
title: m.title
}
}">
{{ m.title }}
</router-link>
</li>
</ul>
<hr>
<router-view></router-view>
</div>
</template>
<script>
import detail from "@/pages/Detail.vue";
export default {
name: "Message",
computed: {
detail() {
return detail
}
},
data() {
return {
messageList: [
{id: '001', title: '消息001'},
{id: '002', title: '消息002'},
{id: '003', title: '消息003'}
]
}
}
}
</script>