优化调整

This commit is contained in:
2023-07-12 01:36:35 +08:00
parent 92d102c346
commit e6106c073f
15 changed files with 211 additions and 157 deletions

View File

@@ -9,17 +9,17 @@
</span>
<div style="margin-top: 10px;display: flex;flex-direction: row;flex-wrap: wrap;align-items: center;font-size: 12px;color: #1f2937">
<span style="display: flex;justify-content: flex-start"> 作者: </span>
<span style="margin-left: 5px"> {{articleList.username}} </span>
<span v-if="articleList.username" style="margin-left: 5px"> {{articleList.username}} </span>
<span style="margin-left: 5px"></span>
<span style="margin-left: 5px">发布于 </span>
<span style="margin-left: 5px">{{articleList.publishtime}}</span>
<span v-if="articleList.publishtime" style="margin-left: 5px">{{articleList.publishtime}}</span>
<span style="margin-left: 5px"></span>
<span style="margin-left: 5px">阅读: </span>
<span style="margin-left: 5px">{{ formatNumber(articleList.ReadCount) }}</span>
<span v-if="articleList.ReadCount" style="margin-left: 5px">{{ formatNumber(articleList.ReadCount) }}</span>
</div>
</div>
<div style="width: 100px;height: 100px;margin-right: 10px">
<el-avatar :size="100" shape="square" :src="articleList.articleico"></el-avatar>
<el-avatar v-if="articleList.articleico" :size="100" shape="square" :src="articleList.articleico"></el-avatar>
</div>
</div>
</template>
@@ -37,7 +37,11 @@ export default {
},
computed:{
brief: function() {
return this.articleList.ArticleContent.substr(0, 100) + '...';
if(this.articleList.ArticleContent){
return this.articleList.ArticleContent.substr(0, 100) + '...';
}else{
return false;
}
},
},
methods:{
@@ -45,12 +49,17 @@ export default {
return num >= 1e3 && num < 1e4 ? (num / 1e3).toFixed(1) + 'k' : num >= 1e4 ? (num / 1e4).toFixed(1) + 'w' : num
},
goArticleDetail(){
this.$router.push({
path:'/ArticleDetail',
query: {
id: this.articleList.ArticleId,
refresh: true
}})
if(this.articleList.ArticleId){
this.$router.push({
path:'/ArticleDetail',
query: {
id: this.articleList.ArticleId,
refresh: true
}})
}else{
return false;
}
// console.log(this.$route.query.id)
},
}