document is not defined

Posted liumcb

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了document is not defined相关的知识,希望对你有一定的参考价值。

报错:document is not defined

解决办法:进行window的逻辑判断

if (typeof window !== ‘undefined‘) {
  ....
}

以上是关于document is not defined的主要内容,如果未能解决你的问题,请参考以下文章

VuePress在build打包时window document is not defined

ReferenceError: ** is not defined

phonegap build Uncaught ReferenceError: onLoad is not defined

火狐 event is not defined

module is not defined vue怎么解决

为啥这段代码会抛出 ReferenceError: test is not defined?