|
1 | 1 | <template> |
2 | | - <Page> |
3 | | - <ActionBar class="action-bar" title="Hello"> |
4 | | - <NavigationButton text="Go Back" android.systemIcon="ic_menu_back" @tap="$navigateBack" /> |
5 | | - <StackLayout orientation="horizontal"> |
6 | | - <Image src="res://icon" width="40" height="40" verticalAlignment="center" @tap="open"/> |
7 | | - <Label text="NativeScript" fontSize="24" verticalAlignment="center" /> |
8 | | - </StackLayout> |
9 | | - </ActionBar> |
10 | | - <GridLayout colums="*" rows="*"> |
11 | | - <Dialog ref="drawer" v-model="drawerState"> |
12 | | - <Label text="main mian mian" /> |
13 | | - <StackLayout slot="bottom"> |
14 | | - <Label text="Im in the bottom drawer" /> |
15 | | - <Label text="Im in the bottom drawer" /> |
16 | | - <Label text="Im in the bottom drawer" /> |
17 | | - <Label text="Im in the bottom drawer" /> |
18 | | - </StackLayout> |
19 | | - <Frame /> |
20 | | - </Dialog> |
21 | | - </GridLayout> |
22 | | - </Page> |
| 2 | + <Page> |
| 3 | + <ActionBar class="action-bar" title="Hello"> |
| 4 | + <NavigationButton text="Go Back" android.systemIcon="ic_menu_back" @tap="$navigateBack" /> |
| 5 | + <StackLayout orientation="horizontal"> |
| 6 | + <Image src="res://icon" width="40" height="40" verticalAlignment="center" @tap="open" /> |
| 7 | + <Label text="NativeScript" fontSize="24" verticalAlignment="center" /> |
| 8 | + </StackLayout> |
| 9 | + </ActionBar> |
| 10 | + <GridLayout colums="*" rows="*"> |
| 11 | + <Dialog ref="drawer" v-model="drawerState"> |
| 12 | + <Label text="main mian mian" /> |
| 13 | + <StackLayout slot="bottom"> |
| 14 | + <Label text="Im in the bottom drawer" /> |
| 15 | + <Label text="Im in the bottom drawer" /> |
| 16 | + <Label text="Im in the bottom drawer" /> |
| 17 | + <Label text="Im in the bottom drawer" /> |
| 18 | + </StackLayout> |
| 19 | + <Frame /> |
| 20 | + </Dialog> |
| 21 | + </GridLayout> |
| 22 | + </Page> |
23 | 23 | </template> |
24 | 24 |
|
25 | 25 | <script> |
26 | 26 | export default { |
27 | 27 | data() { |
28 | 28 | return { |
29 | | - msg: "Hello World! ", |
30 | | - listOfItems:[{text:'111'},{text:'2222'},{text:'3333'}], |
31 | | - drawerState: false, |
| 29 | + msg: 'Hello World! ', |
| 30 | + listOfItems: [{ text: '111' }, { text: '2222' }, { text: '3333' }], |
| 31 | + drawerState: false |
32 | 32 | }; |
33 | 33 | }, |
34 | 34 | methods: { |
35 | | - open:function(){ |
36 | | - console.log('打开了'); |
37 | | - if(this.drawerState == 'bottom'){ |
38 | | - this.drawerState = false; |
39 | | - }else{ |
40 | | - this.drawerState = 'bottom' |
41 | | - console.log('xxxx',this.drawerState); |
42 | | - } |
43 | | - //this.$refs.drawer.open('bottom') |
| 35 | + open: function() { |
| 36 | + console.log('打开了'); |
| 37 | + if (this.drawerState == 'bottom') { |
| 38 | + this.drawerState = false; |
| 39 | + } else { |
| 40 | + this.drawerState = 'bottom'; |
| 41 | + console.log('xxxx', this.drawerState); |
44 | 42 | } |
| 43 | + //this.$refs.drawer.open('bottom') |
| 44 | + } |
45 | 45 | } |
46 | 46 | }; |
47 | 47 | </script> |
48 | 48 |
|
49 | 49 | <style scoped> |
50 | | -.wrap{ |
51 | | - border-width:1; |
52 | | - border-color: red; |
53 | | - background-color: green; |
| 50 | +.wrap { |
| 51 | + border-width: 1; |
| 52 | + border-color: red; |
| 53 | + background-color: green; |
54 | 54 | } |
55 | 55 | ActionBar { |
56 | 56 | background-color: #53ba82; |
|
0 commit comments