无法识别的起始角色

时间:2015-01-12 21:29:51

标签: javascript pug

我想使用我可以使用&attributes完成的变量来设置对象的属性,但我似乎无法让它工作。

- var attributes = { type: 'text' };
input&attributes

应该产生:

<input type="text" />

但是我收到了这个错误:

unrecognized start character

1 个答案:

答案 0 :(得分:0)

您需要将attributes变量实际传递到&attributes

- var attributes = { type: 'text' };
input&attributes(attributes)