mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 21:48:42 +08:00
test(virtual-scroll): add second page to vs basic
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
import { Component, ViewChild, ElementRef, NgModule } from '@angular/core';
|
import { Component, NgModule } from '@angular/core';
|
||||||
import { IonicApp, IonicModule, Platform } from '../../../..';
|
import { IonicApp, IonicModule, NavController, Platform } from '../../../..';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -7,11 +7,9 @@ import { IonicApp, IonicModule, Platform } from '../../../..';
|
|||||||
})
|
})
|
||||||
export class E2EPage {
|
export class E2EPage {
|
||||||
items: any[] = [];
|
items: any[] = [];
|
||||||
webview: string;
|
webview: string = '';
|
||||||
|
|
||||||
@ViewChild('content') content: ElementRef;
|
constructor(platform: Platform, public navCtrl: NavController) {
|
||||||
|
|
||||||
constructor(platform: Platform) {
|
|
||||||
for (var i = 0; i < 200; i++) {
|
for (var i = 0; i < 200; i++) {
|
||||||
this.items.push({
|
this.items.push({
|
||||||
value: i,
|
value: i,
|
||||||
@ -22,11 +20,14 @@ export class E2EPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (platform.is('ios')) {
|
if (platform.is('ios')) {
|
||||||
if (window.indexedDB) {
|
if (platform.testUserAgent('Safari')) {
|
||||||
this.webview = ': WKWebView';
|
this.webview = ': iOS Safari';
|
||||||
|
|
||||||
|
} else if (!!window['webkit']) {
|
||||||
|
this.webview = ': iOS WKWebView';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.webview = ': UIWebView';
|
this.webview = ': iOS UIWebView';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -35,10 +36,13 @@ export class E2EPage {
|
|||||||
if (index % 4 === 0) {
|
if (index % 4 === 0) {
|
||||||
return index + ' is divisible by 4';
|
return index + ' is divisible by 4';
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pushPage() {
|
||||||
|
this.navCtrl.push(E2EPage);
|
||||||
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
window.location.reload(true);
|
window.location.reload(true);
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,10 @@
|
|||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
|
|
||||||
|
<div padding>
|
||||||
|
<button ion-button (click)="pushPage()">Push Virtual Scroll Page</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ion-list [virtualScroll]="items"
|
<ion-list [virtualScroll]="items"
|
||||||
[headerFn]="headerFn">
|
[headerFn]="headerFn">
|
||||||
|
|
||||||
@ -25,4 +29,8 @@
|
|||||||
|
|
||||||
</ion-list>
|
</ion-list>
|
||||||
|
|
||||||
|
<div padding>
|
||||||
|
<button ion-button (click)="pushPage()">Push Virtual Scroll Page</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
Reference in New Issue
Block a user