【发布时间】:2019-06-01 20:44:52
【问题描述】:
我正在使用 Wintersmith,需要将 location.hash 作为变量访问。
这是我尝试过的,但它产生了Cannot read property 'location' of undefined 错误:
- var hash = window.location.hash
- var articles = env.helpers.getArticles(contents, hash)
img(data-item = i, src="img/events/"+hash+'/' +a)
【问题讨论】:
-
错误信息是什么?
-
@AngelM。无法读取未定义的属性“位置”
标签: pug wintersmith