nativescript-community / ui-drawer

NativeScript plugin that allows you to easily add a side drawer (side menu) to your projects.
https://nativescript-community.github.io/ui-drawer/
Apache License 2.0
24 stars 12 forks source link

Doesn't work with Vue3 #23

Closed tralves closed 1 year ago

tralves commented 1 year ago

Please, tell us how to recreate the issue in as much detail as possible.

I spent some time trying to implement support for Vue3.

Here's my attempt: https://github.com/tralves/ui-drawer/tree/add-vue3-support I was heavily inspired on SwipeMenu's implementation, but it doesn't work.

I can see that my Drawer component (https://github.com/tralves/ui-drawer/blob/add-vue3-support/src/ui-drawer/vue3/component.ts) is created but not the NativeDrawer component (https://github.com/tralves/ui-drawer/blob/add-vue3-support/src/ui-drawer/vue3/index.ts)

If anyone know the solution or wants to try themselves, I'd be very thankful.

Thanks!

tralves commented 1 year ago

It works now! See PR: https://github.com/nativescript-community/ui-drawer/pull/24

It works well. The examples all run. There are some things I couldn't quite understand:

1- It is using the wrapper component src/ui-drawer/vue3/component.ts. The exported methods don't work (they cause an infinite loop). Instead, I am just calling the open and close methods directly on the nativeView (e.g. this.$refs['drawer'].nativeView.open(side);). I have a feeling I saw this happening before in another plugin...

2- For some reason these methods don't work if called from a function registered in setup() or Githubissues.

  • Githubissues is a development platform for aggregating issues.