diff --git a/src/views/public/articles/index.vue b/src/views/public/articles/index.vue index 9c7b441..c36fc50 100644 --- a/src/views/public/articles/index.vue +++ b/src/views/public/articles/index.vue @@ -114,7 +114,7 @@ import { getSetting } from '@/api/user' let divTyping = document.getElementById('article-title') let i = 0,timer = 0,str = this.userSetting.backgroundTextSite function typing () { - if (i <= str.length) { + if (str && i <= str.length) { divTyping.innerHTML = str.slice(0, i++) timer = setTimeout(typing, 100) } else {