🎨 修改文章列表

This commit is contained in:
ronger 2021-06-28 10:32:13 +08:00
parent 1b4f1008dd
commit 64d2a748e4

View File

@ -4,7 +4,7 @@
<el-col v-for="article in articles.articles" :key="article.idArticle" style="padding-bottom: 1rem;"> <el-col v-for="article in articles.articles" :key="article.idArticle" style="padding-bottom: 1rem;">
<el-card> <el-card>
<div class="card-body d-flex flex-column"> <div class="card-body d-flex flex-column">
<el-link rel="nofollow" @click="onRouter('article',article.articleLink)" :underline="false" <el-link rel="nofollow" :href="article.articleLink"
style="margin-bottom: .5rem;"> style="margin-bottom: .5rem;">
<h4> <h4>
<span v-if="isPerfect(article.articlePerfect)" style="color: gold;" title="优选"> <span v-if="isPerfect(article.articlePerfect)" style="color: gold;" title="优选">
@ -31,8 +31,7 @@
</el-col> </el-col>
<el-col :xs="16" :sm="16" :xl="16"> <el-col :xs="16" :sm="16" :xl="16">
<div> <div>
<el-link rel="nofollow" @click="onRouter('user', article.articleAuthor.userAccount)" :underline="false" <el-link rel="nofollow" :href="'/user/' + article.articleAuthor.userAccount" class="text-default">
class="text-default">
{{ article.articleAuthorName }} {{ article.articleAuthorName }}
</el-link> </el-link>
<small class="d-block text-muted">{{ article.timeAgo }}</small> <small class="d-block text-muted">{{ article.timeAgo }}</small>
@ -76,19 +75,6 @@ export default {
currentChange(page) { currentChange(page) {
this.$emit('currentChange', page); this.$emit('currentChange', page);
}, },
onRouter(name, data) {
if ("article" === name) {
this.$router.push({
path: data
})
} else {
this.$router.push(
{
path: '/user/' + data
}
)
}
},
isPerfect(articlePerfect) { isPerfect(articlePerfect) {
return articlePerfect === '1'; return articlePerfect === '1';
} }