brotherton-erpnext/erpnext/public/js/education/web-academy/components/AcademyCourseCardButton.vue

21 lines
625 B
Vue
Raw Normal View History

2018-11-02 15:21:24 +00:00
<template>
<button :class="className" class='btn btn-primary btn-sm btn-block' @click="$router.push($route.path + '/' + course + '/' + nextContentType + '/' + nextContent)">{{ buttonName }}</button>
</template>
<script>
export default {
props: ['course', 'nextContent', 'nextContentType'],
name: "AcademyCourseCardButton",
data() {
return {
buttonName: 'Start',
className: 'btn-primary'
}
},
mounted() {
if(this.$root.$data.checkCourseCompletion(this.course)){
this.buttonName = 'Completed'
this.className = 'btn-success'
}
}
};
</script>