brotherton-erpnext/erpnext/public/js/education/lms/components/Article.vue

42 lines
1.1 KiB
Vue
Raw Normal View History

2018-11-01 11:50:04 +00:00
<template>
<div>
<ContentTitle :title="contentData.title" :author="contentData.author" :publishDate="contentData.publish_date">
2018-11-02 05:59:02 +00:00
<slot></slot>
</ContentTitle>
2018-11-01 11:50:04 +00:00
<section class="article-content-section">
<div class='container'>
2018-11-01 14:21:33 +00:00
<div class="content" v-html="contentData.content"></div>
2018-11-01 11:50:04 +00:00
<div class="text-right">
</div>
<div class="mt-3 text-right">
<a class="text-muted" href="/report"><i class="octicon octicon-issue-opened" title="Report"></i> Report a
Mistake</a>
</div>
</div>
</section>
</div>
</template>
<script>
import ContentTitle from './ContentTitle.vue'
2018-11-01 11:50:04 +00:00
export default {
props: ['content', 'type'],
2018-11-13 11:54:07 +00:00
name: 'Article',
2018-11-01 11:50:04 +00:00
data() {
return {
2018-11-01 14:21:33 +00:00
contentData: ''
2018-11-01 11:50:04 +00:00
}
},
mounted() {
this.getContent().then(data => this.contentData = data);
},
methods: {
getContent() {
return frappe.db.get_doc(this.type, this.content)
}
2018-11-02 05:59:02 +00:00
},
components: {
ContentTitle
2018-11-01 11:50:04 +00:00
}
};
</script>