Skip to content

Commit ccd5366

Browse files
committed
demo: update
1 parent 8055347 commit ccd5366

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

demo-snippets/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@nativescript/hook": "~2.0.0",
4141
"copy-webpack-plugin": "^10.2.4",
4242

43-
"nativescript-vue-template-compiler": "~2.9.0",
43+
"nativescript-vue-template-compiler": "~2.9.3",
4444
"scss-symbols-parser": "^2.0.1",
4545
"string-replace-loader": "^3.1.0"
4646
},

demo-snippets/vue/Tabs.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<NavigationButton text="Back" android.systemIcon="ic_menu_back" @tap="onNavigationButtonTap" />
55
</ActionBar>
66
<GridLayout rows="*, 0" backgroundColor="red">
7-
<MDTabs ref="tabs" :swipeEnabled="false" :animationEnabled="false" :unloadOnTabChange="false" backgroundColor="green" selectedIndex="1">
7+
<MDTabs ref="tabs" :swipeEnabled="false" :animationEnabled="true" :unloadOnTabChange="false" backgroundColor="green" v-model="selectedIndex">
88
<!-- The bottom tab UI is created via MDTabStrip (the containier) and MDTabStripItem (for each tab)-->
99
<MDTabStrip>
1010
<MDTabStripItem>
@@ -27,14 +27,19 @@
2727
<Page>
2828
<GridLayout backgroundColor="red" @loaded="onLoaded('red')">
2929
<Label text="Home Page" class="h2 text-center"></Label>
30+
<Button text="change" @tap="selectedIndex=1"/>
3031
</GridLayout>
3132
</Page>
3233
</Frame>
3334
</MDTabContentItem>
3435
<MDTabContentItem>
35-
<GridLayout backgroundColor="green" @loaded="onLoaded('green')">
36+
<Frame id="inner2">
37+
<Page>
38+
<GridLayout backgroundColor="green" @loaded="onLoaded('green')">
3639
<Label text="Account Page" class="h2 text-center" @tap="addPage"></Label>
37-
</GridLayout>
40+
</GridLayout>
41+
</Page>
42+
</Frame>
3843
</MDTabContentItem>
3944
</MDTabs>
4045
</GridLayout>
@@ -43,7 +48,7 @@
4348

4449
<script lang="ts">
4550
import { Frame } from '@nativescript/core/ui/frame';
46-
import { TabContentItem, Tabs } from '@nativescript-community/ui-material-tabs/';
51+
import { TabContentItem, Tabs } from '@nativescript-community/ui-material-tabs';
4752
import { Color, EventData, GridLayout, Label, StackLayout } from '@nativescript/core';
4853
4954
import Vue from 'vue';
@@ -55,6 +60,7 @@ export default Vue.extend({
5560
data() {
5661
return {
5762
title,
63+
selectedIndex:0,
5864
addThirdItem: false
5965
};
6066
},

demo-snippets/webpack.config.vue.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ NsVueTemplateCompiler.registerElement('MDSlider', () => require('@nativescript-c
3232
event: 'valueChange'
3333
}
3434
});
35+
NsVueTemplateCompiler.registerElement('MDTabs', () => require('@nativescript-community/ui-material-tabs').Slider, {
36+
model: {
37+
prop: 'selectedIndex',
38+
event: 'selectedIndexChange'
39+
}
40+
});
3541

3642
module.exports = (env, webpack) => {
3743
const platform = env && ((env.android && 'android') || (env.ios && 'ios'));

0 commit comments

Comments
 (0)