0.0.5 • Published 6 years ago
ionic-address-picker v0.0.5
前言:
网路上已经有ionic-city-picer等插件,为什么还要再写一个?
由于网路上其他的ionic-city-picker不能满足一些业务需求,如2级联动,或4级联动,以及保存当时的选择状态等。
为了满足更多的业务需求,于是我这里又写了一个希望可以给正在做IONIC开发的同志们一些效率上的帮助;
Install
npm install ionic-address-picker
Using ionic-address-picker module in an Ionic 2 app
/* 使用方法 */
/*------------------------------------------------*/
import { AddressPickerModule } from 'ionic-address-picker';
/*------------------------------------------------*/
@NgModule({
declarations: [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage,
],
imports: [
BrowserModule,
AddressPickerModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage,
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}
/*QQ442970923(如发现Bug请与我联系,将进行改进)*/
/*---------------------HTML---------------------*/
<ion-header>
<ion-navbar>
<ion-title>Home</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<address-picker></address-picker>
</ion-content>
输入属性
名称 | 类型 | 默认 | 描述 |
---|---|---|---|
placeholder | string | 无 | 默认文字 |
Reset | 无 | 无 | 有值时会重置 |
LeveL | number | 无 | 选择联动的层数(最大4;最小1) |
cancelText | string | '取消' | 取消文字 |
DoneText | string | '完成' | 完成文字 |
columnWidth | number | 无 | 每列的宽度(%) |
PickerData | [] | 无 | 城市联动数据 |
输出事件
key | 类型 | 描述 |
---|---|---|
Done | event | Done($event)返回选择时的数据 |