在这里遇到一个奇怪的问题。我有一个非常基本的玉/哈巴狗包括在这里:
SELECT * FROM Promo
WHERE membership = '1'
AND promoStatus = '1'
AND startDate + ' ' + startTime <= CONVERT(NVARCHAR, GetDate(), 101) + ' ' +
CONVERT(NVARCHAR, DATEPART(hh, GetDate())) + ':' +
RIGHT('0' + CONVERT(NVARCHAR, DATEPART(mi, GetDate())), 2)
AND endDate + ' ' + endTime >= CONVERT(NVARCHAR, GetDate(), 101) + ' ' +
CONVERT(NVARCHAR, DATEPART(hh, GetDate())) + ':' +
RIGHT('0' + CONVERT(NVARCHAR, DATEPART(mi, GetDate())), 2)
快速说明,只使用扩展基(没有扩展名)只是不起作用。但是这包括出现以下错误:
extends base.pug
block vars
- var title = 'Home'
block body
header
include ./includes/header.pug
但改为:
TypeError: Cannot read property 'replace' of undefined
at before (/var/node/website/node_modules/pug-linker/index.js:104:48)
at walkAST (/var/node/website/node_modules/pug-walk/index.js:13:26)
at /var/node/website/node_modules/pug-walk/index.js:21:16
at Array.map (native)
at walkAST (/var/node/website/node_modules/pug-walk/index.js:20:29)
at walkAST (/var/node/website/node_modules/pug-walk/index.js:33:21)
at /var/node/website/node_modules/pug-walk/index.js:21:16
at Array.map (native)
at walkAST (/var/node/website/node_modules/pug-walk/index.js:20:29)
at /var/node/website/node_modules/pug-walk/index.js:21:16
at Array.map (native)
at walkAST (/var/node/website/node_modules/pug-walk/index.js:20:29)
at applyIncludes (/var/node/website/node_modules/pug-linker/index.js:102:10)
at link (/var/node/website/node_modules/pug-linker/index.js:21:9)
at compileBody (/var/node/website/node_modules/pug/lib/index.js:84:11)
at Object.exports.compile (/var/node/website/node_modules/pug/lib/index.js:164:16)
完美无缺。 header.jade和header.pug的内容完全相同,所以我在这里有点困惑。一些帮助将不胜感激。
谢谢,
PS:搜索确实显示:https://github.com/pugjs/pug-linker/issues/13 - 似乎是一个错误,但不确定这是怎么回事。
答案 0 :(得分:4)
所以看起来帕格并没有为黄金时段做好准备!期待它是什么时候,但使用玉而不是帕格解决问题,只需将所有内容重命名为.jade
。
答案 1 :(得分:0)
从Jade搬到Pug的一个突破性变化是你不能再插入变量了。您曾经能够(并鼓励)在另一个字符串中使用#{something}
,但现在建议您使用常规JavaScript变量。
例如,这个
a(href="#{link}")
a(href='before#{link}after')
现在应该成为
a(href=link)
a(href=`before${link}after`) //(on Node.js/io.js ≥ 1.0.0)
a(href='before' + link + 'after') //(everywhere)
来源:跟踪issue并发生重大变化。