@@ -8,7 +8,7 @@ export interface VueBottomSheetOptions extends Omit<BottomSheetOptions, 'view'>
8
8
}
9
9
10
10
declare module 'nativescript-vue' {
11
- interface NativeScriptVue < V = View > extends Vue {
11
+ interface NativeScriptVue < V = View > extends Vue {
12
12
$showBottomSheet ( component : typeof Vue , options ?: VueBottomSheetOptions ) : Promise < any > ;
13
13
$closeBottomSheet ( ...args ) ;
14
14
}
@@ -23,22 +23,24 @@ function serializeModalOptions(options) {
23
23
24
24
const allowed = [ 'fullscreen' ] ;
25
25
26
- return Object . keys ( options )
27
- . filter ( key => allowed . includes ( key ) )
28
- . map ( key => `${ key } : ${ options [ key ] } ` )
29
- . concat ( `uid: ${ ++ sequentialCounter } ` )
30
- . join ( ', ' ) + '_bottomsheet' ;
26
+ return (
27
+ Object . keys ( options )
28
+ . filter ( ( key ) => allowed . includes ( key ) )
29
+ . map ( ( key ) => `${ key } : ${ options [ key ] } ` )
30
+ . concat ( `uid: ${ ++ sequentialCounter } ` )
31
+ . join ( ', ' ) + '_bottomsheet'
32
+ ) ;
31
33
}
32
34
33
35
const BottomSheetPlugin = {
34
36
install ( Vue ) {
35
- Vue . prototype . $showBottomSheet = function ( component , options : VueBottomSheetOptions ) {
37
+ Vue . prototype . $showBottomSheet = function ( component , options : VueBottomSheetOptions ) {
36
38
return new Promise ( ( resolve : ( ...args ) => void ) => {
37
39
let resolved = false ;
38
40
let navEntryInstance = new Vue ( {
39
41
name : 'BottomSheetEntry' ,
40
42
parent : this . $root ,
41
- render : h =>
43
+ render : ( h ) =>
42
44
h ( component , {
43
45
props : options . props ,
44
46
key : serializeModalOptions ( options )
@@ -65,8 +67,8 @@ const BottomSheetPlugin = {
65
67
) ;
66
68
} ) ;
67
69
} ;
68
- Vue . prototype . $closeBottomSheet = function ( ...args ) {
69
- ( this . nativeView ) . closeBottomSheet . apply ( this . nativeView , args ) ;
70
+ Vue . prototype . $closeBottomSheet = function ( ...args ) {
71
+ this . nativeView . closeBottomSheet . apply ( this . nativeView , args ) ;
70
72
} ;
71
73
}
72
74
} ;
0 commit comments