File tree Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,17 @@ registerElement(
113
113
)
114
114
registerElement (
115
115
'NativeActionBar' ,
116
- ( ) => require ( 'tns-core-modules/ui/action-bar' ) . ActionBar
116
+ ( ) => require ( 'tns-core-modules/ui/action-bar' ) . ActionBar ,
117
+ {
118
+ removeChild ( parent , child ) {
119
+ try {
120
+ parent . nativeView . _removeView ( child . nativeView )
121
+ } catch ( e ) {
122
+ // ignore exception - child is likely already removed/replaced
123
+ // fixes #76
124
+ }
125
+ }
126
+ }
117
127
)
118
128
registerElement (
119
129
'NativeActionItem' ,
Original file line number Diff line number Diff line change
1
+ const Vue = require ( './nativescript-vue' )
2
+
3
+ Vue . config . debug = true
4
+ Vue . config . silent = false
5
+
6
+ new Vue ( {
7
+ data : {
8
+ selectedTab : 0
9
+ } ,
10
+ template : `
11
+ <Frame>
12
+ <Page>
13
+ <ActionBar title="Issue #76">
14
+ <SearchBar v-if="selectedTab === 0" />
15
+ <Label v-else-if="selectedTab === 1" text="Second" />
16
+ <Label v-else text="Third" />
17
+ </ActionBar>
18
+ <StackLayout>
19
+ <TabView v-model="selectedTab">
20
+ <TabViewItem title="First">
21
+ <Label text="First"/>
22
+ </TabViewItem>
23
+ <TabViewItem title="Second">
24
+ <Label text="Second"/>
25
+ </TabViewItem>
26
+ <TabViewItem title="Third">
27
+ <Label text="Third"/>
28
+ </TabViewItem>
29
+ </TabView>
30
+ </StackLayout>
31
+ </Page>
32
+ </Frame>
33
+ ` ,
34
+ created ( ) {
35
+ console . log ( Vue . compile ( this . $options . template ) . render . toString ( ) )
36
+ }
37
+ } ) . $start ( )
You can’t perform that action at this time.
0 commit comments