<template>
    <div id="app">
        <VideoUploader v-model="itemData.url" @change="save"/>
    </div>
</template>

<script>
import TimeRangeSelector from './components/TimeRangeSelector.vue'
import { getSyllabusListById, getFirstCoursewareBySyllId, getPidPathName } from '@/api/syllabus'
import VideoUploader from './components/VideoUploader.vue'

export default {
    name: 'App',
    components: {
        TimeRangeSelector,
        VideoUploader
    },
    data() {
        return {
            itemData: {
                url: "",
            }
        };
    },
    async mounted() {
        this.getData();
    },
    methods: {
        async getData() {
            const res = await this.$getData();
            if(!res) {
                // 默认数据
                this.itemData = {
                    url: "",
                }
            } else {
                this.itemData = res
            }
        },

        
        // 保存数据
        save() {
            console.log(this.itemData)
            this.$setData(this.itemData)
        },

        handleUploading(progress) {

        }
    }
}
</script>

<style>
body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background-color: #FFFFFF;
}

#app {}
</style>
