From a416adaa686a1fb3412569f7fafcc7f77454c12f Mon Sep 17 00:00:00 2001 From: zema1 Date: Sat, 23 Dec 2017 18:19:52 +0800 Subject: [PATCH] fix mathjax.hub not defined --- src/pages/oj/views/general/Announcements.vue | 4 +++- src/pages/oj/views/problem/Problem.vue | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pages/oj/views/general/Announcements.vue b/src/pages/oj/views/general/Announcements.vue index 7825131ed..5e462541a 100644 --- a/src/pages/oj/views/general/Announcements.vue +++ b/src/pages/oj/views/general/Announcements.vue @@ -95,7 +95,9 @@ this.announcement = announcement this.listVisible = false this.$nextTick(() => { - window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, 'problem-content']) + if (window.MathJax) { + window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, 'problem-content']) + } }) }, goBack () { diff --git a/src/pages/oj/views/problem/Problem.vue b/src/pages/oj/views/problem/Problem.vue index 0f36c0d61..1bd1c9f17 100644 --- a/src/pages/oj/views/problem/Problem.vue +++ b/src/pages/oj/views/problem/Problem.vue @@ -270,7 +270,9 @@ api[func](this.problemID, this.contestID).then(res => { this.$Loading.finish() this.$nextTick(() => { - window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, 'problem-content']) + if (window.MathJax) { + window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, 'problem-content']) + } }) let problem = res.data.data this.changeDomTitle({title: problem.title})