Skip to content

Commit

Permalink
feat : 動態路由
Browse files Browse the repository at this point in the history
  • Loading branch information
susu3131 committed Oct 3, 2023
1 parent b9b5c3d commit b2e33cd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Empty file added deploy.sh
Empty file.
8 changes: 7 additions & 1 deletion pages/product.vue
@@ -1,8 +1,14 @@
<script lang="ts" setup></script>
<script lang="ts" setup>
const id = 123;
const id2 = 456;
</script>

<template>
<div>
<p>product</p>
<nuxt-link :to="`/product/${id}`" style="margin-right: 8px">商品細節1</nuxt-link>
<nuxt-link :to="`/product/${id2}`">商品細節2</nuxt-link>
<NuxtPage />
</div>
</template>

Expand Down
9 changes: 9 additions & 0 deletions pages/product/[id].vue
@@ -0,0 +1,9 @@
<script lang="ts" setup></script>

<template>
<div>
<p>id: {{ $route.params.id }}</p>
</div>
</template>

<style scoped></style>

0 comments on commit b2e33cd

Please sign in to comment.