Please Like, Share, Subscribe & Comment - it all helps me create more content! 👉 Vue 3 Composition API Course: dannys.link/compositionapi 👉 My Courses: dannys.link/courses
I want to be successful like you Danny! I hope, I'll learn from you a lot! Please create course how to create MVP apps and earn like Indie App Developer. Because this is my dream.
As someone who's just learning Vue now and is working on a Quasar project that was scaffolding without the script setup syntax, it was slightly tricky to figure out how to change all my components to use the script setup "sugar" . On the official Vue docs it does claim it improves performance and is easier to read through though
Hi Danny, in an older video i asked this question. I did not include the code because i was testing this video. Weird things are happening. In you code at timestamp you used "counter.value++" to increment the counter. What's odd are: (1) Howcome you could change the value of a "const"? (2) I used "this.counter++ and it still worked but i thought that this "this" should not be used. The script for HomeView.vue: - {{ counter }} + import { defineComponent } from 'vue' import { ref, reactive } from 'vue'; export default { setup() { const counter = ref('20'); const updateCounter = function (type) { if (type === '-') { this.counter--; } else { this.counter++; } }; return { counter, updateCounter, }; }, };
I just did some playing around and it seems that this works, but only when using the *setup function* pattern (like in your code) but it does not work when using the *script setup* pattern (which the pattern the Vue team now recommends). I assume the reason it works with the setup function pattern is because, in this context, the *this* keyword refers to the setup() function and since the counter ref is declared at the top level of the setup() function, *this.counter* will refer to it. However, I'm not quite sure why you don't need to do *this.counter.value* - that is strange. Honestly I don't know how to explain this right now, but I'll look into it. Regarding the *const* question, this is explained here: stackoverflow.com/a/23436563
@@MakeAppswithDanny Thank you for the reply. The reason i did that code is really i forget to change and as it worked i didnt think of it until i continued the video and when i had to add more code i realised the oddity. Hmmmm... Thank you for the explanation but it has serious implications. When someone change over from setup() to script setup. You are the only trainer who replies comments effectively . Keep up with the good work. Waiting for the full course in composition API. Will in be available in your site or udemy (my preference as i have so many courses in there as library).
It was the easiest one to install and use in a standard Vue project created with the Vue build tool (I wanted to stick with Vue build tool projects in the course). But it’s really not a Bulma course at all. We are just using it to make the app look pretty but not going into detail about Bulma. The focus is Vue 3 and composition api. 👍
@@MakeAppswithDanny There is of course a Quasar Vite plugin, but completely get your reasoning for the choices. Love your videos and look forward to purchasing this course when it is available. Keep up the great work!