前提・実現したいこと
vue.jsでECサイトにあるようなカート機能を作成しています。
以下のソースコードでは遷移先に商品の色とサイズが反映されません。
どのようにすれば反映させられますでしょうか。
該当のソースコード
親component(遷移元:色、サイズを選択する商品ページ)
<template> <v-container fluid> <v-layout row wrap align-center> <v-flex xs12 sm6> <v-subheader v-text="'Size'"></v-subheader> </v-flex> <v-flex xs12 sm6> <v-select :items="sizes" :menu-props="{ maxHeight: '400' }" label="Select" persistent-hint ></v-select> </v-flex> <v-flex xs12 sm6> <v-subheader v-text="'color'"></v-subheader> </v-flex> <v-flex xs12 sm6> <v-select :items="colors" label="Select" chips persistent-hint ></v-select> </v-flex> <v-btn block color="secondary" dark @click="submit"> ADD TO CART </v-btn> </v-layout> </v-container> </template> <script> import Cart from '../components/Cart.vue' export default{ data (){ return{ sizes: [ 'S', 'M', 'L' ], colors:[ '白', 'グレー', '黒' ], } }, methods: { submit(){ this.$router.push('/shop/item/cart') } }, components:{ Cart, } } </script>
子component(遷移先:ショッピングカート)
<template> <v-container text-xs-center justify-center> <div>{{sizes}}</div> <div>{{colors}}</div> </v-container> </template> <script> export default { props:['sizes','colors'], } </script>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/07/21 02:38
2019/07/21 04:18
2019/07/24 16:32
2019/07/24 21:03