Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor article preview #102

Merged
merged 8 commits into from Nov 18, 2018
@@ -0,0 +1,20 @@
<template>
<ul class="tag-list">
<li
class="tag-default tag-pill tag-outline"
v-for="(tag, index) of tags"
:key="index"
>
<span v-text="tag" />
</li>
</ul>
</template>

<script>
export default {
name: "TagList",
props: {
tags: Array
}
};
</script>
@@ -1,36 +1,43 @@
<template>
<div class="article-preview">
<rwv-article-meta
<RwvArticleMeta
isPreview
:article="article"
:isPreview="true">
</rwv-article-meta>
/>
<router-link
:to="{name: 'article', params: {'slug': article.slug}}"
class="preview-link">
<h1>{{article.title}}</h1>
<p>{{article.description}}</p>
:to="articleLink"
class="preview-link"
>
<h1 v-text="article.title" />
<p v-text="article.description" />
<span>Read more...</span>
<ul class="tag-list">
<li class="tag-default tag-pill tag-outline"
v-for="(tag, index) of article.tagList"
:key="tag + index">
{{ tag }}
</li>
</ul>
<TagList :tags="article.tagList" />
</router-link>
</div>
</template>

<script>
import RwvArticleMeta from "@/components/ArticleMeta";
import RwvArticleMeta from "./ArticleMeta";
import TagList from "./TagList";
export default {
name: "RwvArticlePreview",
components: {
RwvArticleMeta,
TagList
},
props: {
article: { type: Object, required: true }
},
components: {
RwvArticleMeta
computed: {
articleLink() {
return {
name: "article",
params: {
slug: this.article.slug
}
};
}
}
};
</script>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.