我搜索了四周,我找不到一個真正有效的。下劃線模板_.templateSettings的正確鬍鬚模板配置是什麼?
在小鬍子裏,當你拋出2個捲曲的時候,裏面的字符串將被轉義,而如果你拋出3個字符,它就不會。
// when you pass {foo: '"bar"'} as hash, the following template will be:
{{foo}} // => "bar"
{{{foo}}} // => "bar"
對不對?所以我創建了以下內容。
http://jsfiddle.net/beatak/6s5PU/
這說明內插和相對逸出,這意味着2捲曲爲未轉義3逃脫。當我在escape
和interpolate
之間翻轉_.templateSettings
時,它不起作用。爲什麼?下劃線模板優先於那三個(escape
,interpolate
和evaluate
)?
我知道我無視的jsfiddle evaluate
現在,如果一起工作,那將是非常美妙的,但現在,我想使2件3捲曲的作品就好了... ...
你在'underscore.js:1151'中得到'Uncaught SyntaxError:Unexpected token]'。可能是一個bug;一個JavaScript字符串被連接起來並試圖被評估。 ([在此部分](http://underscorejs.org/docs/underscore.html#section-133)) –