npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ionic5-alpha-scroll

v0.2.6

Published

Improved version of https://github.com/zwq8299174/ionic-alpha-scroll

Downloads

1

Readme

ionic-alpha-scroll

一款基于ionic的索引列表插件,类似于原生APP的通讯录页面、微信的联系人页面、汽车之家的汽车品牌页面等等,首字母进行索引然后滑动。

一个耿直的程序猿因为业务需要,需要做一个类似原生应用联系人页面的索引列表功能。在网上找了许久许久,包括github和其他网站,虽然有类似的,但是不是闪屏就是卡顿还有抖动,都无法满足程序猿的需要,所以他决定自己写一个插件,然后就是`ionic-alpha-scroll`这个插件了。

丝般顺滑的滑动,不卡顿、不闪屏、不抖动,接近原生的滚动体验。

#更新:

20171103

1、新增自定义头部模板功能。感谢@Yan Xiaodi

DEMO

DEMO 源码地址:https://github.com/zwq8299174/ionic-alpha-scroll-demo

Animated demo

安装

1、使用npm安装

npm install ionic-alpha-scroll --save

2、在app.module.ts中引入

import { AlphaScrollModule } from 'ionic-alpha-scroll';
 @NgModule({
	 ...
	 imports: [
		...
		AlphaScrollModule.forRoot(),
		...
	]
})

使用

1、在页面中引入

<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>

2、数据格式

数据格式要求为数组类型,元素为对象或数组都可以,最好是对象格式。需要包含当前元素的首字母,本插件没有提取首字母功能。比如汽车品牌列表,单个品牌对象如下

{
	id:"1",
	initial:"A",
	logo:"http://api.jisuapi.com/car/static/images/logo/300/1.png",
	name:"奥迪",
	parentid:"0"
}

其中initial为首字母的字段。

Api

listData

列表数据,格式为Array,数组元素为对象。

key

列表元素首字母字段的名字

itemTemplate

列表元素所使用的模板,需结合页面上ng-template所使用。

currentPageClass

当前使用索引列表的页面主体class

License

This content is released under the MIT License.