nativescript-community / ui-material-components

Monorepo that contains all of the NativeScript Material Design plugins.
https://nativescript-community.github.io/ui-material-components/
Apache License 2.0
219 stars 80 forks source link

feat: add vue2 & vue3 listener support to bottomsheet #434

Closed Logikgate closed 1 year ago

Logikgate commented 1 year ago

Currently the only way to get an update from the bottomsheet vue component is via directly calling the $closeBottomSheet method with some return arguments.

However, when a user swipes to close the bottomsheet there is no opportunity for us to call $closeBottomSheet.

This pull request adds the ability to directly apply listeners to the vue component in the bottomsheet so that we can get updates from it.

vallemar commented 1 year ago

looks good, @rigor789 I wonder if we can add this to the modals in ns-vue3??

Logikgate commented 1 year ago

looks good, @rigor789 I wonder if we can add this to the modals in ns-vue3??

@vallemar kind of a side note but, in vue2 we've devised a way to declaratively define modals so we don't have to pass any props or listeners to the components in them. Below is an example usage of our FDialog component that handles all of the binding of listeners and props to the parent component. Essentially we never use $showModal or $navigateTo anywhere in our app anymore.

It is currently vue2 only so not sure if that is of interest to you at all. I could try to pull our FDialog code out of our repo so it could be used elsewhere.

Screen Shot 2023-02-16 at 10 40 43 AM
farfromrefug commented 1 year ago

@Logikgate i like it. Thanks!