【发布时间】:2018-08-12 16:00:12
【问题描述】:
当page 加载 Nuxt.js 时如何运行代码?
如果浏览器支持使用!!window.ontouchstart 的触摸事件,我想添加一个类。
我试过了,但 window 未定义:
```
<section v-bind:class="{ touch: !!window.ontouchstart }">
...
</section>
```
【问题讨论】:
-
查看了 10,000 次。一个赞成票。