-
Notifications
You must be signed in to change notification settings - Fork 22.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Vue] Vue guide should use Composition API #35693
Comments
@chrisdavidmills Our guide is not using the Vue 3 Composition API; it's using the old (soft-deprecated) Options API and that needs updating for sure. However this was just audited in #33167 so I believe it should at least work. In particular, it doesn't look like you actually set anything up in |
Thanks for your help, @Josh-Cena! Yup, in my speed of rushing through the tutorial to try and test the PR content, I misread it and added the props and data to the App component, not the TodoItem component. I've updated it today, and it now works, so all good. I'm going to leave this open for now, as I think something still needs to be done at least in the short term to tell the reader to update |
I'm repurposing this issue to upgrade us to Composition API. If someone sends a PR saying "you should remove |
MDN URL
https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Client-side_JavaScript_frameworks/Vue_first_component
What specific section or headline is this issue about?
No response
What information was incorrect, unhelpful, or incomplete?
I tried to provide a review for #35676 (I later noticed @bsmth had been assigned as the reviewer, so I stopped), but I came up against several errors that were quick tricky to debug. I gave up after a while because it was taking too much of my time.
First of all, the default generated
App.vue
component uses this new<script setup>
feature, which seems to be no longer require theexport
statements, and gives an error if you include them. I read https://vuejs.org/guide/components/registration.html, which helped me figure it out.Second, I could not get my props to work, either with the
<script set>
route, or with the older<script>
route that requires theexport
statements. I have got them registered inApp.vue
and included in my template:And I have got them included in my
ToDoItem.vue
template:But I still get a todo item rendered showing no label, and and errors as follows:
I am not sure what I've missed. I never had this much trouble setting up this app when I worked on the original view guide!
What did you expect to see?
A working app
Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
No response
The text was updated successfully, but these errors were encountered: