Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/assets/vue/views/user/courses/List.vue

45 lines
943 B

<template>
<div class="course-list">
{{ status }}
<CourseCardList
:courses="courses"
/>
</div>
</template>
<script>
import CourseCardList from './CourseCardList';
import ListMixin from '../../../mixins/ListMixin';
import {ENTRYPOINT} from '../../../config/entrypoint';
import axios from "axios";
export default {
name: 'CourseList',
servicePrefix: 'Course',
components: {
CourseCardList
},
mixins: [ListMixin],
data() {
return {
status: null,
courses: []
};
},
created: function () {
this.load();
},
methods: {
load: function () {
this.status = 'Loading';
let user = this.$store.getters['security/getUser'];
axios.get(ENTRYPOINT + 'users/' + user.id + '/courses.json').then(response => {
this.status = '';
this.courses = response.data;
}).catch(function (error) {
console.log(error);
});
}
}
};
</script>