File tree 1 file changed +45
-0
lines changed
1 file changed +45
-0
lines changed 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
+ const CompButton = {
7
+ template : `
8
+ <Button @tap="counter++">{{label}}: {{counter}}</Button>
9
+ ` ,
10
+ name : 'CompButton' ,
11
+ props : [ 'label' ] ,
12
+ data ( ) {
13
+ return {
14
+ counter : 0
15
+ }
16
+ }
17
+ }
18
+
19
+ new Vue ( {
20
+ data : {
21
+ counter : 0
22
+ } ,
23
+ template : `
24
+ <Frame>
25
+ <Page>
26
+ <ActionBar title="Issue #127" />
27
+
28
+ <StackLayout>
29
+ <Button @tap="counter++">{{counter}}</Button>
30
+
31
+ <keep-alive>
32
+ <CompButton v-if="counter % 2" key="odd" label="Odd"></CompButton>
33
+ <CompButton v-else key="even" label="Even"></CompButton>
34
+ </keep-alive>
35
+ </StackLayout>
36
+ </Page>
37
+ </Frame>
38
+ ` ,
39
+ created ( ) {
40
+ console . log ( Vue . compile ( this . $options . template ) . render . toString ( ) )
41
+ } ,
42
+ components : {
43
+ CompButton
44
+ }
45
+ } ) . $start ( )
You can’t perform that action at this time.
0 commit comments