나는 handlebars, patternlab-node 및 gulp가있는 프로젝트에서 작업 중입니다. 지금 원자 012에 인수를 전달하려고하면 내 .hbs
파일이 작동하지 않습니다. 아래 예제를 나열했습니다.데이터 변수를 문자열 리터럴로 전달하는 Patternlab 핸들 막대
분자 :
<div class="filter-group {{ filterGroupClass }}">
{{#each filterGroupContent}}
{{> atoms-filter filterClass="{{filterClass}}" filterText="{{filterText}}" filterValue="{{filterValue}}" }}
{{/each}}
</div>
데이터 :
{
"filterGroupClass": "test-class",
"filterGroupContent": [
{
"filterClass": "",
"filterText": "Text",
"filterValue": "9"
},
{
"filterClass": "closed",
"filterText": "Text2",
"filterValue": "9"
}
]
}
아톰 : {{filterText}} {{filterValue}}
대신 텍스트 :
<span class="unit">
<a class="filter {{filterClass}}" href="">{{filterText}}
<span class="value">{{filterValue}}</span>
</a>
<a class="pill-filter-close" href="">Close</a>
</span>
출력 지금 문자 등으로 표시되는 json 데이터에서. 하지만 그것은 json 파일에서 정보를 얻고 있다고 생각하므로 루프에서 정확한 횟수를 표시하고 있습니다.
구문 오류인지 다른 문제인지 잘 모르겠지만 어떤 도움을 받으실 수 있습니다.
기꺼이 도와 드리겠습니다. –