From 24193fd5c1a55e62bed2adc3ca6e800e3c204b4e Mon Sep 17 00:00:00 2001 From: XiaoMo Date: Thu, 6 Apr 2023 19:20:14 +0800 Subject: [PATCH] =?UTF-8?q?a1300399510@qq.com=20=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BA=8E=202023/04/06=20-19:20:02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 3 ++- src/views/detail/detailIndex.vue | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main.js b/src/main.js index 93b56bc..c76439d 100755 --- a/src/main.js +++ b/src/main.js @@ -2,7 +2,7 @@ import Vue from 'vue' import App from './App.vue' import router from './router' import store from './store' -import ElementUI, { Message, Pagination } from 'element-ui'; +import ElementUI, { Message, Pagination, loading } from 'element-ui'; import 'element-ui/lib/theme-chalk/index.css'; import { skipUrl, pageStop, pageMove, goTologin, copy, startupUnderLoading, closeUnderLoading, formattedDate } from "@/utils/common.js" import http from "@/utils/request" @@ -21,6 +21,7 @@ Vue.prototype.$goTologin = goTologin // 跳转登录页面的方法 Vue.prototype.$pageStop = pageStop // 页面禁止滑动 Vue.prototype.$pageMove = pageMove // 页面可以滑动 Vue.prototype.$Message = Message // 消息提示框 +Vue.prototype.$loading = loading // 消息提示框 Vue.prototype.$copy = copy // 复制 Vue.prototype.$startupUnderLoading = startupUnderLoading // 开启加载提示 element的 Vue.prototype.$closeUnderLoading = closeUnderLoading // 关闭加载提示 element的 diff --git a/src/views/detail/detailIndex.vue b/src/views/detail/detailIndex.vue index 53e3fd1..bd054f3 100755 --- a/src/views/detail/detailIndex.vue +++ b/src/views/detail/detailIndex.vue @@ -136,10 +136,10 @@
-
{{ item.author }}
+
{{ item.author }} +
{{ $formattedDate(item.dateline) }}
@@ -450,6 +450,8 @@ export default { count: 0, }, + loading: null, // 加载中 + }; }, @@ -462,6 +464,7 @@ export default { methods: { // 获取详细信息 getDetail() { + this.$startupUnderLoading(this) this.$http.post("/api/thread", { tid: this.tid }).then(res => { @@ -487,6 +490,8 @@ export default { else if (this.type == 2) this.getInterviewDetails() this.getPostList() + }).finally(() => { + this.$closeUnderLoading(this) }) },