feat: Components to render articles in widget home (#7596)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
committed by
GitHub
parent
fa7bbdb0b3
commit
703e19304d
34
app/javascript/widget/components/ArticleList.vue
Normal file
34
app/javascript/widget/components/ArticleList.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<ul role="list" class="py-2">
|
||||
<article-list-item
|
||||
v-for="article in articles"
|
||||
:key="article.id"
|
||||
:link="article.link"
|
||||
:title="article.title"
|
||||
@click="onClick"
|
||||
/>
|
||||
</ul>
|
||||
</template>
|
||||
<script>
|
||||
import ArticleListItem from './ArticleListItem';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ArticleListItem,
|
||||
},
|
||||
props: {
|
||||
articles: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
onClick(link) {
|
||||
this.$emit('click', link);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user