ionic自定義component
例如要自定義一個component:
用於顯示一個有固定結構的item組成list
假設這是我們要的一個item的效果:
H1Header
item1
item2
item3
1.在終端中執行:ionic g component MyComponent
執行後src目錄中會出現components目錄,其中有我們剛剛建立的my-component目錄,打開後有scss、ts、html和module.ts文件如圖(圖中這個組件的名字叫ChapterList)
src:
my-component.html:
my-component.ts:
最後更新:2017-06-22 22:34:28