Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.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 完整日历,如何在方法中循环数据,并在完整日历中显示_Javascript_Node.js_Vue.js_Axios_Fullcalendar - Fatal编程技术网

Javascript 完整日历,如何在方法中循环数据,并在完整日历中显示

Javascript 完整日历,如何在方法中循环数据,并在完整日历中显示,javascript,node.js,vue.js,axios,fullcalendar,Javascript,Node.js,Vue.js,Axios,Fullcalendar,我有6个计划数据将在完整日历中显示,但在完整日历中表单是数组,因此我必须在数组中输入6个数据,但我不知道如何在数组中输入数据 请帮忙,我还在学习 <template> ... <full-calendar :events="events" /> ... </template> <script> ... data(){ return { events:[] } } .... methods: { get_Sec

我有6个计划数据将在完整日历中显示,但在完整日历中表单是数组,因此我必须在数组中输入6个数据,但我不知道如何在数组中输入数据

请帮忙,我还在学习

<template>
...
   <full-calendar :events="events" />
...
</template>

<script>
...
data(){
    return {
        events:[]
    }
}
....
methods: {
get_Section() {
    this.$ax.get('/course/session').then(response => {
        this.session = response.data.data
        console.log(this.session)

        this.events = [
            for (i = 0; i < this.session; i++) {
                {
                    title: this.session[i].location,
                    start: this.session[i].start_date,
                    end: this.session[i].end_date
                }
            }
        ]
    }
}
}
</script>

...
...
...
数据(){
返回{
事件:[]
}
}
....
方法:{
get_段(){
这个.ax.get('/course/session')。然后(response=>{
this.session=response.data.data
console.log(this.session)
此项。事件=[
对于(i=0;i
事件可以是JSON提要或函数。如果您以预期格式从端点返回数据,则只需将端点提供给FullCalendar即可。如果您需要在客户端转换数据,则可以使用该函数进行ajax调用,并像您已经在做的那样转换数据。是否应该这样做(i=0;i