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) }) },