一款基于ionic的索引列表插件,类似于原生APP的通讯录页面、微信的联系人页面、汽车之家的汽车品牌页面等等,首字母进行索引然后滑动。
MIT License
ionicAPP
github`ionic-alpha-scroll`
DEMO https://github.com/zwq8299174/ionic-alpha-scroll-demo
npm
npm install ionic-alpha-scroll --save
app.module.ts
import { AlphaScrollModule } from 'ionic-alpha-scroll';
@NgModule({
...
imports: [
...
AlphaScrollModule.forRoot(),
...
]
})
<ion-alpha-scroll *ngIf="contacts.length>0"
[listData]="contacts"
key="name"
[itemTemplate]="alphaScrollItemTemplate"
[currentPageClass]="currentPageClass">
</ion-alpha-scroll>
<ng-template
#alphaScrollItemTemplate
let-item="item"
let-currentPageClass="currentPageClass">
<ion-item (click)="currentPageClass.onItemClick(item)">
<h2>{{item?.name}}</h2>
</ion-item>
</ng-template>
{
id:"1",
initial:"A",
logo:"http://api.jisuapi.com/car/static/images/logo/300/1.png",
name:"",
parentid:"0"
}
initial
Array
ng-template
class
This content is released under the MIT License.