1818import { EventData , View } from ' @nativescript/core' ;
1919import * as frameModule from ' @nativescript/core/ui/frame' ;
2020import { NativeScriptVue } from ' nativescript-vue' ;
21- import { inject } from ' vue' ;
2221import BottomSheetInner from ' ./BottomSheetInner.vue' ;
2322import BottomSheetInnerKeyboard from ' ./BottomSheetInnerKeyboard.vue' ;
23+ import { useBottomSheet } from " @nativescript-community/ui-material-bottomsheet/vue3" ;
2424
2525const title = ' BottomSheet sample' ;
2626const name = ' BottomSheet' ;
27- const $showBottomSheet = inject (' $showBottomSheet' )
2827
28+ const { showBottomSheet, closeBottomSheet } = useBottomSheet ()
2929function onNavigationButtonTap() {
3030 frameModule .Frame .topmost ().goBack ();
3131}
@@ -36,7 +36,7 @@ function onTap(args: EventData) {
3636 console .log (' onTap' , objId , obj );
3737 switch (objId ) {
3838 case ' bottomsheet' : {
39- $ showBottomSheet (BottomSheetInner , {
39+ showBottomSheet (BottomSheetInner , {
4040 // transparent: true,
4141 on: {
4242 indexChanged : (x ) => { console .log (' listener' , x ) }
@@ -48,7 +48,7 @@ function onTap(args: EventData) {
4848 break ;
4949 }
5050 case ' dont_ignore_top_safe_area' : {
51- $ showBottomSheet (BottomSheetInner , {
51+ showBottomSheet (BottomSheetInner , {
5252 ignoreTopSafeArea: false ,
5353 // transparent:true,
5454 closeCallback : (... args ) => {
@@ -58,7 +58,7 @@ function onTap(args: EventData) {
5858 break ;
5959 }
6060 case ' ignore_bottom_safe_area' : {
61- $ showBottomSheet (BottomSheetInner , {
61+ showBottomSheet (BottomSheetInner , {
6262 // transparent:true,
6363 ignoreBottomSafeArea: true ,
6464 closeCallback : (... args ) => {
@@ -68,7 +68,7 @@ function onTap(args: EventData) {
6868 break ;
6969 }
7070 case ' dont_ignore_top_ignore_bottom_safe_area' : {
71- $ showBottomSheet (BottomSheetInner , {
71+ showBottomSheet (BottomSheetInner , {
7272 // transparent:true,
7373 ignoreTopSafeArea: false ,
7474 ignoreBottomSafeArea: true ,
@@ -79,15 +79,15 @@ function onTap(args: EventData) {
7979 break ;
8080 }
8181 case ' bottomsheet-keyboard' : {
82- $ showBottomSheet (BottomSheetInnerKeyboard , {
82+ showBottomSheet (BottomSheetInnerKeyboard , {
8383 closeCallback : (... args ) => {
8484 console .log (' bottom sheet closed' , args );
8585 }
8686 });
8787 break ;
8888 }
8989 case ' bottomsheet-peekheight' : {
90- $ showBottomSheet (BottomSheetInner , {
90+ showBottomSheet (BottomSheetInner , {
9191 peekHeight: 100 ,
9292 trackingScrollView: ' scrollView' ,
9393 // transparent: true,
0 commit comments