mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(picker): init picker
This commit is contained in:
77
ionic/components/picker/test/basic/index.ts
Normal file
77
ionic/components/picker/test/basic/index.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import {App, Page, Picker, NavController} from 'ionic-angular';
|
||||
|
||||
|
||||
@Page({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class E2EPage {
|
||||
|
||||
constructor(private nav: NavController) {
|
||||
setTimeout(() => {
|
||||
this.presentPicker()
|
||||
}, 250);
|
||||
}
|
||||
|
||||
presentPicker() {
|
||||
let picker = Picker.create({
|
||||
buttons: [
|
||||
{
|
||||
text: 'Cancel',
|
||||
role: 'cancel'
|
||||
},
|
||||
'Done'
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
prefix: 'prefix',
|
||||
suffix: 'suffix',
|
||||
options: [
|
||||
{ text: 'Jan' },
|
||||
{ text: 'Feb' },
|
||||
{ text: 'Mar' },
|
||||
{ text: 'Apr' },
|
||||
{ text: 'May' },
|
||||
{ text: 'Jun' },
|
||||
{ text: 'Jul' },
|
||||
{ text: 'Aug' },
|
||||
{ text: 'Sep' },
|
||||
{ text: 'Oct' },
|
||||
{ text: 'Nov' },
|
||||
{ text: 'Dec' },
|
||||
]
|
||||
},
|
||||
// {
|
||||
// prefix: 'prefix',
|
||||
// suffix: 'suffix',
|
||||
// options: [
|
||||
// { text: 'Jan' },
|
||||
// { text: 'Feb' },
|
||||
// { text: 'Mar' },
|
||||
// { text: 'Apr' },
|
||||
// { text: 'May' },
|
||||
// { text: 'Jun' },
|
||||
// { text: 'Jul' },
|
||||
// { text: 'Aug' },
|
||||
// { text: 'Sep' },
|
||||
// { text: 'Oct' },
|
||||
// { text: 'Nov' },
|
||||
// { text: 'Dec' },
|
||||
// ]
|
||||
// },
|
||||
]
|
||||
});
|
||||
|
||||
this.nav.present(picker);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@App({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
class E2EApp {
|
||||
root;
|
||||
constructor() {
|
||||
this.root = E2EPage;
|
||||
}
|
||||
}
|
||||
9
ionic/components/picker/test/basic/main.html
Normal file
9
ionic/components/picker/test/basic/main.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<ion-navbar *navbar>
|
||||
<ion-title>Picker</ion-title>
|
||||
</ion-navbar>
|
||||
|
||||
<ion-content padding>
|
||||
|
||||
<button block class="e2ePresentPicker" (click)="presentPicker()">Picker</button>
|
||||
|
||||
</ion-content>
|
||||
Reference in New Issue
Block a user