fastify-dx icon indicating copy to clipboard operation
fastify-dx copied to clipboard

Vue example not reactive + not detected by devtool

Open tumulte opened this issue 3 years ago • 7 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the bug has not already been reported

Fastify version

3

Plugin version

0.03

Node.js version

18

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

Monterey 12.6

Description

I'm just trying out the vue ts example, everything works fine but vue is not reactive (i.e : the original data is displayed, but if I do a simple count++ it won't update. It is also not detected by vue devtool

I use a basic vue-ts example from the dev branch, the only thing I've changed is updating @vueuse/core to latest

Steps to Reproduce

Just install the basic vue example, try reactivity

Expected Behavior

No response

tumulte avatar Oct 16 '22 21:10 tumulte

Hi

Can you share a demo repository / stackblitz?

It will be helpful to see a demonstration of what you did.

Thanks!

davidmeirlevy avatar Oct 17 '22 06:10 davidmeirlevy

@davidmeirlevy sure https://github.com/Tumulte/fastifydx-test

you can go to /admin to see the most basic example.

tumulte avatar Oct 17 '22 12:10 tumulte

@Tumulte can you try to use setup function instead of the the options API?

davidmeirlevy avatar Oct 17 '22 16:10 davidmeirlevy

@davidmeirlevy I have. I've tweaked using-store.vue to make it a simple "push" in an array... with no effect

tumulte avatar Oct 17 '22 16:10 tumulte

You need to wrap the array with ref() function, as mentioned at the reactivity model of Vue's composition API.

davidmeirlevy avatar Oct 17 '22 16:10 davidmeirlevy

@davidmeirlevy ah sorry... I'm not too fan of the composition api but I've updated test-store to a working component (tested within a pure vue app (in a folder frontOnlyTest))... sadly no reactivity or vue detection whatsoever

tumulte avatar Oct 17 '22 17:10 tumulte

Fastify DX alpha is terribly outdated — wait for the public beta featuring Vite 3 support and many other fixes in just 3 days from now 😉

galvez avatar Oct 17 '22 17:10 galvez