Static GitHub Issues

[1471] Cannot read property 'params' of undefined

prev: Auth Routes example is broken
next: Allow a particular nested page to be nested in terms of URL only
<template>
    <div class="wrap_content page">
        <div class="content">
            <LeftSide/>
            <div class="content_catalog">
                <div class="top_block">
                    <div class="bread">Товары</div>
                    <div class="grid_buttons">
                        <div class="grid btn on">
                            <span></span>
                            <span></span>
                            <span></span>
                        </div>
                        <div class="list btn">
                            <span></span>
                            <span></span>
                            <span></span>
                        </div>
                    </div>
                </div>
        <div class="description">
            <img :src="good.image" alt="">
            <h1>{{good.brend}}</h1>
            <p>{{good.description}}</p>
        </div>
                <GoodsGrid/>
        </div>
        </div>

    </div>
</template>


<script>
    import GoodsGrid from '~/components/goodsGrid'
    import LeftSide from '~/components/leftSide'

    export default {
        validate ({ params }) {
            // Must be a number
            return /^\d+$/.test(params.id)
        },
//        good()  {
//            return data.goods.filter((good) => String(good.id) === params.id);
//        },
        layout: 'headerAndFooter',
        components: {GoodsGrid,
            LeftSide},
        data ({params}) {
           let goods = [
                {
                    "id": 1,
                    "title": "Сосиски", 
                    "promo": false,
                    "description": "Атяшево  ", 
                    "image": "/img/content/tovar1.png", 
                    "brend": "Атяшево",
                    "brend_id": 2,
                    "min_price": "99.33",
                    "rate": 4.5,
                    "count_rate": 348
                },
                {
                    "id": 2,
                    "title": "Сардельки", 
                    "promo": false,
                    "description": "фрутоняня ",
                    "image": "/img/sliders/brand8.png", 
                    "brend": "фрутоняня",
                    "brend_id": 2,
                    "min_price": "99.33",
                    "rate": 4.5,
                    "count_rate": 348
                }
            ];
            return {
                good: goods.filter((good) => String(good.id) === params.id)
            }
        }
    }
</script>

I try to get element of array goods, And substitute its values depending on the id (dynamically)

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1311">#c1311</a>)</em></sub></div>