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

45 lines
1.1 KiB
Vue
Raw Normal View History

2018-11-01 11:50:04 +00:00
<template>
<div>
2018-11-13 11:54:07 +00:00
<Title :title="contentData.title" :author="contentData.author" :publishDate="contentData.publish_date">
2018-11-02 05:59:02 +00:00
<slot></slot>
2018-11-13 11:54:07 +00:00
</Title>
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>
2018-11-13 11:54:07 +00:00
import Title from './Title.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() {
frappe.call({
method: "erpnext.www.lms.get_content",
2018-11-01 11:50:04 +00:00
args: {
content_name: this.content,
content_type: this.type
}
}).then(r => {
2018-11-01 14:21:33 +00:00
this.contentData = r.message
2018-11-01 11:50:04 +00:00
});
2018-11-02 05:59:02 +00:00
},
components: {
2018-11-13 11:54:07 +00:00
Title
2018-11-01 11:50:04 +00:00
}
};
</script>