Тёмный

Vue.js 3.0 Composition API Tutorial in 15 minutes 

Program With Erik
Подписаться 123 тыс.
Просмотров 30 тыс.
50% 1

Опубликовано:

 

3 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 77   
@ProgramWithErik
@ProgramWithErik 4 года назад
Check out my workshop! course.vuecourse.tech/workshop
@anthonypetruzzi158
@anthonypetruzzi158 4 года назад
With all due respect, I'm 7 minutes in and there is no explanation of what the composition API is, nor the benefits of using it. I don't see how this is a tutorial.
@officialAXVin
@officialAXVin 4 года назад
Same
@Pecex
@Pecex 4 года назад
It only makes sense when the components get really large.
@glowiever
@glowiever 4 года назад
this. only new syntax was shown, nothing much
@kipruto253
@kipruto253 3 года назад
because it's like Erik doesn't know what it is he just know how its implemented and that how basically all tutorials are like ...pretty shallow
@vaibhavksh
@vaibhavksh 3 года назад
Also, when returning repos data from github api, he says "gh has rate limiting" because it's returning 30 entries at a time. It will have rate limiting, but that was pagination. SMH.
@muslim2k
@muslim2k 4 года назад
Your channel is a treasure to vuemankind!
@ProgramWithErik
@ProgramWithErik 4 года назад
Thanks
@marekurbanowicz
@marekurbanowicz 4 года назад
Small, but an important mistake at the very beginning: "Some backend languages like NODE". Node is not a backend language. You are sort of influencer, so please be precise, so more junior people won't get it wrong.
@demonicious_
@demonicious_ 4 года назад
Node, as in Node.js is a server-side language. Not sure where the issue lies.
@marekurbanowicz
@marekurbanowicz 4 года назад
@@demonicious_ this is completely wrong statement. "Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine." It's runtime for JS, not the different language.
@julisch94
@julisch94 2 года назад
Thanks for pointing this out. I was looking for a comment like this to upvote it. Node.js to Javascript is what Java VM is to Java.
@GrahamSutt
@GrahamSutt 4 года назад
How is the Composition API better than the tools we already have to achieve the same thing in Vue 2? I've been hearing and reading a lot of buzz about the Composition API, but I honestly don't see the benefit compared to using watch, data, methods, etc. Just seems like a fancy way to do the same thing. Maybe I'm missing something?
@jeremy21212121
@jeremy21212121 4 года назад
My understanding is that it is meant to be beneficial when creating large applications. I don't there is a benefit for small demo apps. One cool thing about Vue 3 is the ability to make data non-reactive. Previously with Vue any data properties were reactive, which has an overhead if that data doesn't need to be.
@liana6054
@liana6054 3 года назад
How did you enter a new line for in 11:58? That would help me a lot!!!
@jaydeepsharma4942
@jaydeepsharma4942 3 года назад
add before or after the {{your_data}}
@ivindtobiasjorfald8133
@ivindtobiasjorfald8133 2 года назад
Thanks for the vid! Fun fact: Erik written your way is a hugely common name in Scandinavia, so that's probably why you can't get the username anywhere. :)
@jenmikeandfamily8255
@jenmikeandfamily8255 4 года назад
could you use selectors for styling the components and elements? i suggest just because the id's and class's are distracting from the code your writing, and would likely help viewers learn from you content more efficiently
@miguelstevens3042
@miguelstevens3042 3 года назад
What VSCode theme is that? Lovely
@sadrashadmand552
@sadrashadmand552 4 года назад
your keyboard sound is lovely sir :-D
@ProgramWithErik
@ProgramWithErik 4 года назад
Glad you like it!
@sadrashadmand552
@sadrashadmand552 4 года назад
@@ProgramWithErik, yeah and now I have to buy one in Iran with all these sanctions (from us) and hard times in economic problems! :-D jokes aside thank you for your content.
@LeoPacheco87
@LeoPacheco87 4 года назад
Hey, Erik! Thanks for the vue3 and ts content! Quick question, why would I use this syntax over over just firing a method and populating the lis? Thanks!
@ProgramWithErik
@ProgramWithErik 4 года назад
I wanted to illustrate how the watch function can be triggered when any reactive variable changes. For example we could use the same watch function if the username was coming from a prop. Or maybe another function changed the user name, the watch would still be triggered.
@dovydasmiknys1419
@dovydasmiknys1419 3 года назад
why would you use a watcher, when you could just fetch on click ? Dont understand the ‘newName’ logic. Its basically @click fetch with extra steps
@Kirill-nd3qv
@Kirill-nd3qv 2 года назад
This might be a really silly question, but what keyboard do you use? That clicking sound is amazing. Not such amazing as your tutorials, but anyways.
@ProgramWithErik
@ProgramWithErik 2 года назад
Thanks it's a Corsair k70 keyboard. But half the people hate the clicking so I use my non clicky keyboard in my videos now. (Well not as clicky)
@Kirill-nd3qv
@Kirill-nd3qv 2 года назад
@@ProgramWithErik Thank you
@andres87al2
@andres87al2 2 года назад
Thanks man ! :D
@danillofidelgomes6822
@danillofidelgomes6822 3 года назад
nice tutorial, what difference in use this composition api or use a vue 2 structure?
@Kanexxable
@Kanexxable 4 года назад
Vue three is out woo whooo omgomgomg
@mrrolandlawrence
@mrrolandlawrence 4 года назад
Nice. V3 finally here. I was just learning from the beta on the assumption that it would be properly released before I got any good...
@contractorwolf
@contractorwolf 3 года назад
hey Erik, you doing your workshop again? any way to access the recorded vesion of it?
@ProgramWithErik
@ProgramWithErik 3 года назад
Yes! I’m selling the recoding here! Course.vue course.vuecourse.tech/vue3
@contractorwolf
@contractorwolf 3 года назад
@@ProgramWithErik thx, you should update in the video description
@phongthornkhamkankaew6226
@phongthornkhamkankaew6226 3 года назад
Thanks for the great video!! Could you please share for How to call API and allow CORS in Vuejs 3+Vite?
@leonardonam1
@leonardonam1 3 года назад
Thanks.Precisely I'm reviewing the news about Vue 3. will it come more vidios about composition api? Thanks man!
@K2_EastFace
@K2_EastFace 2 года назад
I would like to have more precision during the explanation between reactive & ref. Also I didn't understand well the use of toRefs() Thanks for the content, it's just a feedback for you, I know I can open the documentation but when watching the video it's cool to have the most importants informations
@Maybehassanawad
@Maybehassanawad 3 года назад
I need this keyboard
@shkrmkr
@shkrmkr 4 года назад
Vue 3 is OUT!!!!!!
@alisharobinson7146
@alisharobinson7146 4 года назад
why do you have a watch function? Can you not just use the original name variable? Can't you just make a regular method that gets called on click and fetches the api? That way you don't declare another variable you just use the original since that is what you want. You just choose when to look at the variable and then after you get the data clear the original variable. Idk I'm just confused at why you declare another variable I guess to just demonstrate the watch function. Also I do not know the benefits of using reactive vs ref. Reactive just lets you declare an object and reference its' keys on assignment? Can you not do that with a ref? Idk another video elaborating the difference might be good.
@ProgramWithErik
@ProgramWithErik 4 года назад
Thanks for the feedback Alisha! Yes, I created the other variable so I could use the watch function. This was to illustrate that when any reactive variable inside the watch function changes the whole watch function gets triggered again. You are right I could have put the fetch in it's own regular method, but that would miss the point. Let's say for example the username came not from an input, but from a prop being passed down. In that case you'd have to have some sort of dynamic way of having the fetch re-trigger. That's the power of watch. Also ref and reactive are very similar. The way I like to think about it is, I use reactive for objects and ref for simpler items like booleans, or integers, but I need them to be reactive. You could use Reactive for everything if you wanted too...
@sergiogb
@sergiogb 4 года назад
Great video!
@steveyang4531
@steveyang4531 4 года назад
Could you please share the source code on github. I'd like to learn tailwind css with Vue 3 and postcss. Thank you .
@joshdempsey7184
@joshdempsey7184 4 года назад
Another great video Erik :-)
@ProgramWithErik
@ProgramWithErik 4 года назад
Thanks for watching
@anonymousshooter3636
@anonymousshooter3636 4 года назад
Vue 3 is awesome :)
@leskoding
@leskoding 3 года назад
VIM inside vscode? why just dont use VIM 8 / neovim instead? :D
@ProgramWithErik
@ProgramWithErik 3 года назад
I really like VScode
@AugustoTitan
@AugustoTitan 4 года назад
I'm glad the Composition API is optional, because I really dislike its structure. The Options API is more organized and suitable for more cases.
@markaguilar736
@markaguilar736 4 года назад
sir, how to add tailwind in vue
@HostDotPromo
@HostDotPromo 4 года назад
Had no idea vue 3 came out. Is it easy to update and transition from vue 2?
@ProgramWithErik
@ProgramWithErik 4 года назад
It's still in a release candidate...
@AcunPearce
@AcunPearce 4 года назад
What is your vs code theme?
@ProgramWithErik
@ProgramWithErik 4 года назад
Synthwave 84
@RussPainter8
@RussPainter8 4 года назад
The watch function doesnt specify what property it's watching. What am I missing? Will this get called if any property changes?
@ProgramWithErik
@ProgramWithErik 4 года назад
Russ Painter correct
@RussPainter8
@RussPainter8 4 года назад
@@ProgramWithErik how is that a good thing? Those effects will be running any time anything changes. And that code could be making api callls!! Isn't there a way like in v2 to have watchers be for specified property?
@SupertigerDev
@SupertigerDev 4 года назад
@@RussPainter8 i think variables that use ref() and reactive() will be watched only. A better solution would be to add a function to the click event to search for users.
@glowiever
@glowiever 4 года назад
sorry but I still don't see the benefit of migrating to vue3 yet. already released two non trivial apps using vue2, works just fine. gonna dive deeper though still...
@adibhasib
@adibhasib 2 года назад
You are just watching your other screen when you are stuck and thus solving the problems you are fetching :/
@Yorgarazgreece
@Yorgarazgreece 4 года назад
Pretty sure this doesn't show what composition API tries to solve. Or at least not with this particular example.
@ProgramWithErik
@ProgramWithErik 4 года назад
It's a simple example, I think it does
@nichtverstehen2045
@nichtverstehen2045 4 года назад
"...backend languages like node..." node is not a language! furthermore, there is no such thing as a "backend language". go learn some basics first.
@ProgramWithErik
@ProgramWithErik 4 года назад
That's technically true. Node is JavaScript run time. Next time I'll be more explicit
@BillBrutzman
@BillBrutzman 4 года назад
Consider GoLang
@copycutvideo
@copycutvideo 4 года назад
Oh no what's happened to your glowy 80's theme? Joking ;-)
@ProgramWithErik
@ProgramWithErik 4 года назад
I still have it! I just didn't turn it on
@dasten123
@dasten123 4 года назад
This leaves so many questions open :/
@ProgramWithErik
@ProgramWithErik 4 года назад
Which questions?
@dasten123
@dasten123 4 года назад
@@ProgramWithErik Actually... just about every question one can have regarding the composition API, except maybe the syntax (partially). I was really hoping to see some explanation of _why_ this new API exists. Instead, you showed a code example that would look much better with the options API. That kind of makes the problem many people are having with this API worse.
@adriatic123
@adriatic123 3 года назад
Vue 3 is a complete mess. Unstructured, unlogic, everything that worked better than in Angular and React they messed up. By Bye Vue
@SigmundJaehn
@SigmundJaehn 3 года назад
You realise it’s optional?
@SigmundJaehn
@SigmundJaehn 3 года назад
Also, there are use cases where it makes a lot of sense - for reuse for example.
Далее
Vue 3 Composition API Introduction [FULL TUTORIAL]
23:46
Learn TypeScript With Vue.js 3 In 20 Minutes
22:56
Просмотров 75 тыс.
ЭТО НАСТОЯЩАЯ МАГИЯ😬😬😬
00:19
TRENDNI BOMBASI💣🔥 LADA
00:28
Просмотров 497 тыс.
5 Easy Ways To Pass Info To Vue Components!
26:50
Просмотров 28 тыс.
Vue 3 Script Setup Tutorial - This Changes Everything!
23:40