File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
vuejs3-linkedin-project/src Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 5
5
<h3 >Pizza {{ type }}</h3 >
6
6
<p >Prix : {{ price }} €</p >
7
7
<p >{{ ingredients }}</p >
8
- <router-link
9
- :to =" { name: 'product-details', params: { name: 'un-parametre' } }"
10
- >
8
+ <router-link :to =" { name: 'product-details', params: { name: type } }" >
11
9
Commander >>
12
10
</router-link >
13
11
</div >
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import Contact from "../views/Contact.vue";
4
4
import NotFound from "../views/NotFound.vue" ;
5
5
import ProductDetails from "../views/ProductDetails.vue" ;
6
6
7
+
7
8
const routes = [
8
9
{
9
10
path : "/" ,
@@ -20,6 +21,7 @@ const routes = [
20
21
path : '/products/:name' ,
21
22
name : "product-details" ,
22
23
component : ProductDetails ,
24
+ props : true
23
25
} ,
24
26
{
25
27
path : '/:catchAll(.*)' ,
Original file line number Diff line number Diff line change 46
46
<!-- Description du produit -->
47
47
<div class =" product-description" >
48
48
<h1 >
49
- {{ $route.params.name }}
49
+ {{ title }}
50
50
<img class =" img-best-seller" src =" ../assets/images/best-seller.png" />
51
51
</h1 >
52
52
<p v-show =" notAvailable" >Momentanément indisponible</p >
105
105
106
106
<script >
107
107
export default {
108
+ props: [" name" ],
108
109
data () {
109
110
return {
110
111
product: " Pizza" ,
You can’t perform that action at this time.
0 commit comments