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.
32 lines
435 B
32 lines
435 B
<template> |
|
<h1>列表</h1> |
|
<hr /> |
|
<div class="list"> |
|
<router-link |
|
:to="{ name: 'Detail', query: { id: item.id } }" |
|
v-for="item in courses" |
|
:key="item.id" |
|
> |
|
<li>【{{ item.name }}】</li> |
|
</router-link> |
|
</div> |
|
</template> |
|
|
|
<script setup lang="ts"> |
|
import { ref } from "vue"; |
|
|
|
const courses = ref([ |
|
{ |
|
id: 1, |
|
name: "语文", |
|
}, |
|
{ |
|
id: 2, |
|
name: "数学", |
|
}, |
|
{ |
|
id: 3, |
|
name: "英语", |
|
}, |
|
]); |
|
</script>
|
|
|