How to show data in database in Vue devtools?

会有一股神秘感。 提交于 2020-01-06 06:43:12

问题


When I click in Cars. I want show me the image below.

Has anyone experienced this problem? I'm using Vue Devtools but can't inspect any components on a count of none are showing up.

Advert.vue

<template>
    <div>
        <ul class="list-group">
            <li v-for="category in categories" @click="sendAdvert(category.id)" class="list-group-item display">
                {{ category.name }}
            </li>
        </ul>
    </div>
</template>
<script>
    export default {
        props: ['categories'],
        data() {
            return {
                advert: [],
            }
        },
        methods: {
            sendAdvert(id) {
                axios.get('/adverts/'+id)
                    .then(response => {
                        this.advert = response.data;
                    });
            }
        }
    }
</script>

AdvertController.php

public function show(Request $request, $advert)
{
    return Category::find($advert);
}

来源:https://stackoverflow.com/questions/54271912/how-to-show-data-in-database-in-vue-devtools

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!