mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-17 16:05:53 +08:00
新增部分注释优化一些代码
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
<view class="u-skeleton" v-if="!articleData">
|
||||
<u-empty text="文章暂无内容" mode="list"></u-empty>
|
||||
</view>
|
||||
<!-- <h3>{{routers.title}}</h3> -->
|
||||
<u-parse v-else :html="articleData"></u-parse>
|
||||
</view>
|
||||
</view>
|
||||
@@ -16,18 +15,20 @@ import { getArticleDetail } from "@/api/article.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
routers: "",
|
||||
// 用于接收上一级通过路径传输的数据
|
||||
routers: "",
|
||||
// 请求文章接口后存储文章信息
|
||||
articleData: "",
|
||||
};
|
||||
},
|
||||
onLoad(val) {
|
||||
this.routers = val;
|
||||
|
||||
getArticleDetail(val.id).then((res) => {
|
||||
if (res.data.result) {
|
||||
// 将请求的文章数据赋值
|
||||
this.articleData = res.data.result.content;
|
||||
}
|
||||
// 修改当前NavigationBar(标题头)为文章头部
|
||||
uni.setNavigationBarTitle({
|
||||
title: val.title,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user