From 52f45789f463b93d03fed2c97e2b29db56c0b516 Mon Sep 17 00:00:00 2001 From: yma16 <17685043634@163.com> Date: Wed, 15 Feb 2023 01:54:01 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=B0=81=E8=A3=85=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Article.vue | 17 +++++++++++++++++ src/components/Onlinewebsocket.vue | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/Article.vue b/src/components/Article.vue index 2f85a08..fbd2528 100644 --- a/src/components/Article.vue +++ b/src/components/Article.vue @@ -368,9 +368,26 @@ export default { mounted () { this.articleScrollListen('add') this.initPageSpliteFun() + this.getChallengeDict() // window.addEventListener('onload', this.topVisible()) }, methods: { + getChallengeDict () { + const that = this + that.$axios + .post(that.baseurl + 'dictModel/index/', { + kind: 'challenge' + // 传入索引 + }) + .then((res) => { + that.challengeConfig = res.data.data.map(item => { + return JSON.parse(item.option) + }) + }) + .catch((error) => { + throw Error(error) + }) + }, /** * dom的滚动事件监听 */ diff --git a/src/components/Onlinewebsocket.vue b/src/components/Onlinewebsocket.vue index 847e554..2c417d7 100644 --- a/src/components/Onlinewebsocket.vue +++ b/src/components/Onlinewebsocket.vue @@ -145,7 +145,7 @@ export default { websocketUrl: 'wss://yongma16.xyz/ws-api/', websocket: null, // room 存房间名字,content保存聊天信息的数组 - chat_info: new Array(), + chat_info: [], chat_room: null, room_loc: 0, user: '', -- GitLab