mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(build): rename ionic directory to src and update all references in the build process.
This commit is contained in:
54
src/components/virtual-scroll/test/cards/index.ts
Normal file
54
src/components/virtual-scroll/test/cards/index.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import {ViewEncapsulation} from '@angular/core';
|
||||
import {App, Page} from '../../../../../ionic';
|
||||
|
||||
|
||||
@Page({
|
||||
templateUrl: 'main.html',
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
class E2EPage {
|
||||
items = [];
|
||||
|
||||
constructor() {
|
||||
for (var i = 0; i < 500; i++) {
|
||||
this.items.push({
|
||||
imgSrc: `../../img/img/${images[rotateImg]}.jpg?${Math.random()}`,
|
||||
imgHeight: Math.floor((Math.random() * 50) + 150),
|
||||
name: i + ' - ' + images[rotateImg],
|
||||
content: lorem.substring(0, (Math.random() * (lorem.length - 100)) + 100)
|
||||
});
|
||||
|
||||
rotateImg++;
|
||||
if (rotateImg === images.length) rotateImg = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@App({
|
||||
template: '<ion-nav [root]="root"></ion-nav>',
|
||||
})
|
||||
class E2EApp {
|
||||
root;
|
||||
constructor() {
|
||||
this.root = E2EPage;
|
||||
}
|
||||
}
|
||||
|
||||
const lorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
|
||||
|
||||
const images = [
|
||||
'bandit',
|
||||
'batmobile',
|
||||
'blues-brothers',
|
||||
'bueller',
|
||||
'delorean',
|
||||
'eleanor',
|
||||
'general-lee',
|
||||
'ghostbusters',
|
||||
'knight-rider',
|
||||
'mirth-mobile',
|
||||
];
|
||||
|
||||
let rotateImg = 0;
|
||||
28
src/components/virtual-scroll/test/cards/main.html
Normal file
28
src/components/virtual-scroll/test/cards/main.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<ion-toolbar><ion-title>Virtual Scroll: Cards</ion-title></ion-toolbar>
|
||||
|
||||
<ion-content>
|
||||
|
||||
<div [virtualScroll]="items" approxItemHeight="320px">
|
||||
|
||||
<ion-card *virtualItem="let item">
|
||||
|
||||
<div>
|
||||
<ion-img [src]="item.imgSrc" [height]="item.imgHeight"></ion-img>
|
||||
</div>
|
||||
|
||||
<ion-item>
|
||||
<ion-avatar item-left>
|
||||
<ion-img [src]="item.imgSrc"></ion-img>
|
||||
</ion-avatar>
|
||||
<h2>{{ item.name }}</h2>
|
||||
</ion-item>
|
||||
|
||||
<ion-card-content>
|
||||
{{ item.content }}
|
||||
</ion-card-content>
|
||||
|
||||
</ion-card>
|
||||
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
Reference in New Issue
Block a user