Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/262.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 将响应vue JS追加到组件表中_Javascript_Php_Laravel_Vue.js - Fatal编程技术网

Javascript 将响应vue JS追加到组件表中

Javascript 将响应vue JS追加到组件表中,javascript,php,laravel,vue.js,Javascript,Php,Laravel,Vue.js,我正在尝试将我的响应vue附加到一个表中,但我不能,也不知道为什么。我可以从我的数据库中获取所有数据,我可以在我的web浏览器控制台中显示这些数据,但我的表是空的 我附上我的实际代码 vueJS请求和组件 <template> <div class="tabla-asistencias"> <table class="table table-hover table-striped">

我正在尝试将我的响应vue附加到一个表中,但我不能,也不知道为什么。我可以从我的数据库中获取所有数据,我可以在我的web浏览器控制台中显示这些数据,但我的表是空的

我附上我的实际代码

vueJS请求和组件

    <template>

    <div class="tabla-asistencias">
        <table class="table table-hover table-striped">
            <thead>
                <th>Id</th>
                <th>Fecha</th>
                <th>Estado</th>
            </thead>
            <tbody>
                <tr>
                    <td>{{ datosAsistencia.id }}</td>
                    <td>{{ datosAsistencia.fecha }}</td>
                    <td>{{ datosAsistencia.mensaje }}</td>
                    <td>{{ datosAsistencia.estado }}</td>
                    
                </tr>
            </tbody>
        </table>
    </div>

        
</template>



<script>

    export default {

        data() {
            return {
                datosAsistencia: [],
                isOpen: false,
                selectedItem: {},
            };

        },
        created: function () {
            this.cargar();
        },
        methods: {
            cargar: function () {
                let url = "/getAsistencias";
                axios
                    .get(url)
                    .then((response) => {
                        this.datosAsistencia = response.data;

                    })
                    .catch((error) => console.error(error));
            }
        },
    };
</script>

您需要在其上循环并使用


{{data.id}
{{data.fecha}}
{{data.mensaje}}
{{data.estado}
 (3) [{…}, {…}, {…}, __ob__: Observer]
0: {…}
1: {…}
2: {…}
length: 3
__ob__: Observer {value: Array(3), dep: Dep, vmCount: 0}
__proto__: Array