Replies: 1 comment 3 replies
-
Thank you for sharing that. We actually reverted it: vikejs/vike-vue@a5f189a. I stand to be corrected but I think we don't need |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
vike/docs/pages/useData/+Page.mdx
Line 21 in eb68353
I was agonizing for a long time trying to work with my code, which had exactly the same structure as yours, namely I was trying to do a "spread" for
data
inside a<script setup>
for a component. There were errors. Until I figured out what the problem was (after spending hours, as I have little experience):The vike-vue inside
useData
returns not an object, not a reactive proxy, etc.. It returns a computed property. Which means that the value of the computed data is stored in the.value
property. Only inside a template can you work with data properties as object properties, which is what vue does behind the scene. And inside the component's code, your example will not work. Instead, you should do it like this:Or even may be:
I didn't suggest push request because I don't know what exactly is returned from other plugins from other freemworks. In fact, I think it's important to decide whether to return a computed property (
computed(() => data)
) or a reacitve object (reacitve(data)
). This is a question for the developers of vike-vue, among others ( ping @AurelienLourot @brillout).Beta Was this translation helpful? Give feedback.
All reactions