나는 이런 일을하고 싶지 :변수 템플릿으로 재사용 가능한 UI를 만드는 방법은 무엇입니까?
구성 요소 파일 :
<template name="drop_down">
<span class="dropdown">
{{> primary_element}} <--- load the template named button
<span class="dropdown-panel">
{{> panel_template}} <--- load the template named button_panel
</span>
</span>
</template>
사용법 :
{{> drop_down primary_element="button" panel_template="button_panel"}}
<template name="button"> some styled button </template>
<template name="button_panel"> panel content </template>
하고 난 그냥이
{{> drop_down primary_element="tmp_btn_2" panel_template="tmp_panel_2"}}
<template name="tmp_btn_2"> another button style </template>
<template name="tmp_panel_2"> other panel content </template>
처럼 다시 사용할 수 있습니다
이 데이터 변수로 템플릿을 통해 올 것이다 . – corvid
어떻게 그럴 수 있습니까? –