Added separate ContentTitle component

This commit is contained in:
scmmishra 2018-11-02 11:29:02 +05:30 committed by Aditya Hase
parent d87ca178d8
commit 160d8b0914
3 changed files with 41 additions and 17 deletions

View File

@ -1,21 +1,8 @@
<template>
<div>
<section class='article-top-section video-section-bg'>
<div class='container'>
<div class="row">
<div class="col-md-8">
<h2>{{ contentData.title }}</h2>
<span class="text-muted">
Published on {{ contentData.publish_date }}, by {{ contentData.author }}
</span>
</div>
<div class="col-md-4 text-right">
<slot></slot>
</div>
</div>
<hr>
</div>
</section>
<ContentTitle :title="contentData.title" :author="contentData.author" :publishDate="contentData.publish_date">
<slot></slot>
</ContentTitle>
<section class="article-content-section">
<div class='container'>
<div class="content" v-html="contentData.content"></div>
@ -30,6 +17,7 @@
</div>
</template>
<script>
import ContentTitle from './ContentTitle.vue'
export default {
props: ['content', 'type'],
name: 'ContentArticle',
@ -48,6 +36,9 @@ export default {
}).then(r => {
this.contentData = r.message
});
},
components: {
ContentTitle
}
};
</script>

View File

@ -0,0 +1,33 @@
<template>
<section class='article-top-section video-section-bg'>
<div class='container'>
<div class="row">
<div class="col-md-8">
<h2>{{ title }}</h2>
<span v-if="typeof author !== 'undefined' || variable !== null" class="text-muted">
Published on {{ publishDate }}, by {{ author }}
</span>
</div>
<div class="col-md-4 text-right">
<slot></slot>
</div>
</div>
<hr>
</div>
</section>
</template>
<script>
export default {
props: ['title', 'publishDate', 'author'],
name: 'ContentTitle',
data() {
return {
};
},
};
</script>
<style lang="css" scoped>
</style>

View File

@ -79,7 +79,7 @@ export default {
}
.quiz-section {
padding-top: 3rem !important;
padding-top: 0.5em !important;
padding-bottom: 0rem !important;
}
</style>