Skip to content

Commit a2d5894

Browse files
committed
chore: demo
1 parent c5f55ff commit a2d5894

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

demo-snippets/vue/SimpleGrid.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
<ActionBar>
44
<Label text="Simple Grid" />
55
<ActionItem @tap="refresh" ios.systemIcon="16" ios.position="right" text="refresh" />
6+
<ActionItem @tap="test" ios.systemIcon="12" ios.position="right" text="test" />
67
</ActionBar>
78

89
<GridLayout>
910
<CollectionView
10-
11+
:width="collectionViewWidth"
1112
:items="itemList"
1213
@itemTap="onItemTap"
1314
@loadMoreItems="onLoadMoreItems"
@@ -82,7 +83,8 @@ export default {
8283
{ index: 19, name: 'ASBESTOS', color: '#7f8c8d' }
8384
]);
8485
return {
85-
itemList: items
86+
itemList: items,
87+
collectionViewWidth:"100%"
8688
};
8789
},
8890
methods: {
@@ -305,6 +307,9 @@ export default {
305307
onItemTap({ index, item }) {
306308
console.log(`EVENT TRIGGERED: Tapped on ${index} ${item.name}`);
307309
},
310+
test(){
311+
this.collectionViewWidth = this.collectionViewWidth == "100%" ? "50%" : "100%"
312+
},
308313
refresh() {
309314
this.itemList = ([
310315
{ index: 0, name: 'TURQUOISE', color: '#1abc9c' },

demo-snippets/vue/install.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import Vue from 'nativescript-vue';
2+
import {Trace} from '@nativescript/core';
23

34
import CollectionView from '@nativescript-community/ui-collectionview/vue';
45
import SwipeMenuPlugin from '@nativescript-community/ui-collectionview-swipemenu/vue';
56
import install from '@nativescript-community/ui-collectionview-waterfall';
7+
import { CollectionViewTraceCategory } from '@nativescript-community/ui-collectionview';
68

79
import SimpleGrid from './SimpleGrid.vue';
810
import HorizontalGrid from './HorizontalGrid.vue';
@@ -18,6 +20,9 @@ export function installPlugin() {
1820
install();
1921
}
2022

23+
Trace.addCategories(CollectionViewTraceCategory)
24+
Trace.enable()
25+
2126
export const demos = [
2227
{ name: 'Simple Grid', path: 'simple-grid', component: SimpleGrid },
2328
{ name: 'Horizontal Grid', path: 'horizontal-grid', component: HorizontalGrid },

0 commit comments

Comments
 (0)