brotherton-erpnext/erpnext/public/js/education/lms/components/CourseCardButton.vue
2019-02-19 13:06:32 +05:30

30 lines
861 B
Vue

<template>
<button :class="getClassName" class='btn btn-primary btn-sm btn-block' @click="$router.push($route.path + '/' + course + '/' + nextContentType + '/' + nextContent)">{{ getButtonName }}</button>
</template>
<script>
export default {
props: ['course', 'nextContent', 'nextContentType'],
name: "CourseCardButton",
data() {
return {
buttonName: 'Start',
className: 'btn-primary'
}
},
computed: {
getButtonName: function() {
if(lms.store.checkCourseCompletion(this.course)){
return 'Completed'
}
else{
return 'Start'
}
},
getClassName: function() {
if(lms.store.checkCourseCompletion(this.course)){
return 'btn-success'
}
}
}
};
</script>