ionic自定义component

简介: 在ionic3.x中自定义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:
_2017_06_22_21_30_10
my-component.html:
_2017_06_22_21_34_02
my-component.ts:
_2017_06_22_21_35_52

相关文章
|
8月前
|
设计模式 前端开发 JavaScript
约束性组件( controlled component)与非约束性组件( uncontrolled component)
约束性组件( controlled component)与非约束性组件( uncontrolled component)
|
缓存 JavaScript
75Vue - 使用 v-once 的低级静态组件(Cheap Static Component)
75Vue - 使用 v-once 的低级静态组件(Cheap Static Component)
38 0
|
9月前
|
JavaScript 前端开发 程序员
功能组件( Functional Component )与类组件( Class Component )如何选择?
功能组件( Functional Component )与类组件( Class Component )如何选择?
66 0
|
9月前
Angular多个页面引入同一个组件报错The Component ‘MyComponentComponent‘ is declared by more than one NgModule怎么办?
Angular多个页面引入同一个组件报错The Component ‘MyComponentComponent‘ is declared by more than one NgModule怎么办?
|
9月前
|
编解码 JavaScript 编译器
【Vue warn】If this is a native custom element, make sure to exclude it from component resolution ……
【Vue warn】If this is a native custom element, make sure to exclude it from component resolution ……
动态组件<component :is=‘‘></component>
动态组件<component :is=‘‘></component>
|
前端开发 数据库 容器
AngularJS自定义服务(factory、service、provider)
AngularJS自定义服务(factory、service、provider)
|
Dart API Android开发
Flutter入门:application、module、package、plugin
我们用AS创建flutter项目时,会看到几个选项:application、module、package、plugin。
1132 0
|
Go 开发工具
Go1.13:使用go mod 管理依赖, 提示cannot find module providing package或cannot find main module
Go1.13:使用go mod 管理依赖, 提示cannot find module providing package或cannot find main module
678 0
Go1.13:使用go mod 管理依赖, 提示cannot find module providing package或cannot find main module