vue-query via CDN #8791
Unanswered
levi-knaepkens
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Is it possible to use vue-query through CDN properly? I saw in the documentation that it is possible for react-query, but not for vue-query.
However, there is a CDN via https://www.jsdelivr.com/package/npm/@tanstack/vue-query, I tried it but it doesn't seem to work as it should.
I am building a vue app with no build step, so each package must be delivered via CDN instead of NPM. The imports are collected via an import folder in my html root. I also use vue3-sfc-loader, to use Single File Components and its benefits as much as possible.
I managed to use the CDN, import vue-query into my root and initialize it:
When I try to retrieve data in my app component with useQuery, this is the part where I get stuck. The data is retrieved, but the reactivity of the result object does not seem to be correct. When I look at the logs, the correct values are logged, but the UI does not update. Also, when I destructure the result object, the reactivity is completely lost:
Am I missing something here, or is it just not possible to use vue-query in this way?
Beta Was this translation helpful? Give feedback.
All reactions