7
디렉토리 내에서 내 템플릿 내부를 부분적으로 포함하려고합니다.부분적으로 mustache.js의 경로를 포함합니다.
이 작동 :
{{>header}}
이되지 않습니다
{{>inc/header}}
{{>../header}}
형제 이외의 위치를 포착하지 않는 것. 이게 정상인가?
디렉토리 내에서 내 템플릿 내부를 부분적으로 포함하려고합니다.부분적으로 mustache.js의 경로를 포함합니다.
이 작동 :
{{>header}}
이되지 않습니다
{{>inc/header}}
{{>../header}}
형제 이외의 위치를 포착하지 않는 것. 이게 정상인가?
header
, inc/header
및 ../header
이 부분의 텍스트 값이 렌더링 시간에 전달 오브젝트 부분 지문에서 키의 단지 이름입니다
var tmpl = "{{>header}} {{>inc/header}} {{>../header}}",
data = {},
partials = {
header : "<header>example</header>",
'inc/header' : "<header>xmpl</header>",
'../header' : "whatever"
},
html = Mustache.render(tmpl, data, partials);
document.write(html);
jsFiddle 여기를 참조하십시오