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

30 lines
882 B
Vue
Raw Normal View History

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