代码改变世界

nuxt 使用window对象

2019-10-28 18:16  上山砍柴  阅读(1329)  评论(0编辑  收藏  举报

判断是服务端还是客户端

一般操作dom的方法:

if (process.browser) {
 console.log('此处操作dom')
}