Vue JS 3 Tutorial for Beginners #10 - The Composition API (part 1)

  Рет қаралды 198,876

Net Ninja

Net Ninja

Күн бұрын

Пікірлер: 143
@jakubschulz4353
@jakubschulz4353 3 жыл бұрын
This music when creating a project is the best
@spicemasterii6775
@spicemasterii6775 3 жыл бұрын
Yep. I hope Vue includes it and plays it when creating a project.
@dopamine_Seeker
@dopamine_Seeker 3 жыл бұрын
😂😂😂
@speckyferns6780
@speckyferns6780 2 жыл бұрын
yes, my favorite too. Kind of miss it when my @vue/cli does nothing :)
@FADHsquared
@FADHsquared 3 жыл бұрын
38:25 - FYI people, the syntax is now stable, basically anything you write in is equivalent to writing anything in the setup() hook. And any top-level bindings (imports, variables, function declarations) are "automatically returned" so you don't have to worry about returning yourself anymore!
@oxk4r01
@oxk4r01 3 жыл бұрын
But has errors :( I got one saying there is no export default method...
@iUmerFarooq
@iUmerFarooq 2 жыл бұрын
Hmm... Thank you for this amzing tip ;)
@sophiaonyoutube
@sophiaonyoutube Жыл бұрын
thanks!
@amckee250
@amckee250 Жыл бұрын
Not sure what I love most about these tutorial videos, the concise, in depth explanations or the old timey song played when creating a Vue project :)
@maulik1644
@maulik1644 3 жыл бұрын
The way you explain composition API is amazing 🔥🔥
@NetNinja
@NetNinja 3 жыл бұрын
Thanks a lot 😊
@pewolo
@pewolo 3 жыл бұрын
You know what Shaun, you are the best web development teacher ever, all your words sink in like magic and you took me from zero to hero in Vue JS. There is no word that better describes how amazing you are. May God returns this kindness to you in thousand folds!
@NetNinja
@NetNinja 3 жыл бұрын
Thank you so much for the kind words 🙏
@avidonovan3222
@avidonovan3222 3 жыл бұрын
I guess Im kinda off topic but does anyone know of a good place to stream new series online ?
@pangogeeks
@pangogeeks Жыл бұрын
This is such a CRUCIAL video to watch which will remove doubts about the concept of reactivity in Vue. Before watching it I couldn't get my head around why we use ref for something not related with DOM refs, why not reactive, why computed, etc. You answered all my doubts in one shot! Attashaun and thank you so much!!!
@94sl
@94sl 3 жыл бұрын
This is by far the best video and the most accessible way for me so far to move over from the options API to the new composition API. Thank you a million!
@NetNinja
@NetNinja 3 жыл бұрын
Thank you :). Glad you liked it!
@jackiechan5798
@jackiechan5798 3 жыл бұрын
Great tutorials, i finished watching all your ads as a thank you
@aaravbatra4991
@aaravbatra4991 7 ай бұрын
Dear Shaun, In my carrer of 18 years I have never came accross a YT tutorial as good as yours. You have made learing Vue a cake walk. You are so much clear on what to demo and how to demo. Your contents are very very much structured and totally inline with what a begginer would like to know. I am going to watch all of your tutorials now. Kudos
@NetNinja
@NetNinja 7 ай бұрын
Glad it helped! :) thanks for watching and for your kind words!
@aaravbatra4991
@aaravbatra4991 7 ай бұрын
@@NetNinja lot of respect and love 😊. You are the best teacher
@shaikadnan2186
@shaikadnan2186 3 жыл бұрын
Your videos are great sir!! Quality learning stuff for free!! If I become a web developer in future, it would be totally because of you sir that too for free. Proud to be a NET NINJA
@LKBean
@LKBean 3 жыл бұрын
Thank you soo much for these tutorials! They're clear, concise, easy to follow, and very informative. You, sir, are a wonderful person for making this
@Fryknowledge
@Fryknowledge Жыл бұрын
your explainations are very understandable shaun. It helped me in cracking my first vue interview. Thanks shawn.
@NetNinja
@NetNinja Жыл бұрын
That's awesome to hear :)
@Acuce7ibd468j
@Acuce7ibd468j Жыл бұрын
I watch the Ads till the end cuz ur content deserves to be supported ❤👍. I really appreciate doing more projects in SSR with vue
@NetNinja
@NetNinja Жыл бұрын
Awesome, thank you for your support Mahmoud! :)
@defidelity
@defidelity 2 жыл бұрын
You're really amazing, I recommend your channel to all newbies that I know. I've so far learnt Tailwind, CSS Grid and Vue JS from you. I'll just say you carried my whole frontend experience.
@흐음-u2n
@흐음-u2n 3 жыл бұрын
The best lecture i've ever seen. thank you
@lucapassani1129
@lucapassani1129 2 жыл бұрын
Very nice. Thank you. I was not aware of the composition API and was stuck trying to make sense of a code example that used it. Now everything is clear.
@SohoCode
@SohoCode Жыл бұрын
5:11 favorite part 😁
@hadisergan1
@hadisergan1 3 жыл бұрын
Muslim student of you, from Bangladesh sir [Thank you for your lessons].
@tompearson6540
@tompearson6540 3 жыл бұрын
Thanks for such a clear and detailed video Shaun, great help! Is there a VSCode extension you use to do the auto-import of 'ref' at around 13:30?
@akaandre3562
@akaandre3562 8 ай бұрын
Does anyone else find the loading music when he creates a vue app satisfying? hehe
@hipstersavage
@hipstersavage Жыл бұрын
One of the best teachers on the youtube
@kushranadaioi685
@kushranadaioi685 3 жыл бұрын
nobody: net ninja: create couple of variables, let name = 'Mario' Gets me every time lol
@jeffgoes4116
@jeffgoes4116 2 жыл бұрын
Shaun, thank you for the video and as usual, great content quality! I was wondering what would happen under the hood if we used names.value.filter() directly instead of calling it as a callback of computed()
@sakalbhile
@sakalbhile 2 жыл бұрын
Very detailed explanation 👍
@markusboden6127
@markusboden6127 10 ай бұрын
Me when the download music kicks in at 3 a.m 👯 - Thanks for these tutorials!!!
@NetNinja
@NetNinja 10 ай бұрын
Aha, You're very welcome! :)
@BullWinkleBull
@BullWinkleBull 3 жыл бұрын
Best tutorial!!! Thank you!
@alielzahaby3315
@alielzahaby3315 10 ай бұрын
thanks man you're the one helped me after Allah preparing for my new project that I need to make in work 🙂❤
@NetNinja
@NetNinja 10 ай бұрын
Glad I could help :)
@dil-jay
@dil-jay 3 жыл бұрын
Thanks for this great tutorial
@pangogeeks
@pangogeeks Жыл бұрын
I just wanna add that WHY we use computed is to strip out from templates of some logic which could encumber them. It's better, in fact, to keep the logic and the modifications of our refs in the script rather than in the template
@izzatullokanoatov370
@izzatullokanoatov370 3 жыл бұрын
Awesome explanation. Thank you, brother. Love the way you explain things.
@itsn72
@itsn72 3 жыл бұрын
amazing one Shaun ;)
@ibrahimhalilozhun3306
@ibrahimhalilozhun3306 3 жыл бұрын
Hey Shaun, İ think you should have a MERN Stack course
@kbaker04
@kbaker04 3 жыл бұрын
I don't get why in the template we can access and render the search value as just {{ search }} but in the computed filter we specifically have to access as search.value?
@hadisergan1
@hadisergan1 3 жыл бұрын
thank you sir
@Rivederchee
@Rivederchee 2 жыл бұрын
BOOOT - I love your tutorials
@turalrzaxanov4373
@turalrzaxanov4373 Жыл бұрын
Thanks a lot of such awesome tutorials. God bless you!
@NetNinja
@NetNinja Жыл бұрын
You're very welcome Tural!
@finishitoff
@finishitoff 10 ай бұрын
You got a new subscriber❤
@colinm3130
@colinm3130 3 жыл бұрын
I am still having a hard time understanding what the advantage of using the setup() is over the older way with everything in its own function (computed(), methods(), etc. So far they seem like two different ways to handle things, but I have missed what the reason is to use one over the other. Could someone catch me up?
@esutana
@esutana 3 жыл бұрын
1. the new way can make the coding more organized (similar features groupped together) 2. low-level apis like watch, watchEffect can be used to make more advanced features
@yoduh99
@yoduh99 2 жыл бұрын
"the older way with everything in its own function". except "everything" is usually split between those functions, e.g. created() hook initializes a data() object which is referenced by a computed() property which calls a function in methods()... meaning when you try to follow the logic of something you're constantly jumping around. compare to the composition API where all the logic for accomplishing something is all within the setup() method
@harryscarheadsam
@harryscarheadsam 2 жыл бұрын
@@esutana ​The setup way is confusing for me. Besides, now there are two ways to use it! Also, watch can be used in options api as well!
@adante407
@adante407 3 жыл бұрын
I'm still a little undecided about Vue. Obviously there are less opportunities employment wise which is a determining factor in choosing between React, and Vue. But it also seems learning Vue makes you good at Vue. Whereas learning React makes you good at JavaScript?
@eyriusbacterius
@eyriusbacterius 2 жыл бұрын
Yes i m undecided as well right now :D What did you choose?
@kennethcruz1234
@kennethcruz1234 2 жыл бұрын
I love you so much, sir the net ninja ♥
@runehansen3105
@runehansen3105 3 жыл бұрын
What number branch does the dojo-blog project start in the github repository? I can't find it? What Lesson number is it?
@ME-dg5np
@ME-dg5np Жыл бұрын
Super lessons !! 👍☀️🌲 The best ! 👍☀️
@Dipenparmar12
@Dipenparmar12 2 жыл бұрын
Great tutorial as always. ( FYI: I couldn't find correct source code in mentioned github repo)
@fredpourlesintimes
@fredpourlesintimes 2 жыл бұрын
A lot of new features... Pfew! I'm questionning myself about using or not using the Composition API ; even if it seems interesting to use.
@usmanmughal5916
@usmanmughal5916 3 жыл бұрын
Waiting for next video
@ugurtigu
@ugurtigu 3 жыл бұрын
Hey I've a question: can't you use the index of an element in an array as the key when iterating over them instead of the elements value itself? Because normally an array has not always unique values but the index should be unique?
@junchengdong
@junchengdong 3 жыл бұрын
Then how can you get the index of an element in a for-each loop? Unless you specify it in the data. For example, the "id" of the job does a similar thing since id = index + 1.
@ugurtigu
@ugurtigu 3 жыл бұрын
@@junchengdong you can get the index from for-each arr.forEach(function callback(currentValue [, index [, array]]) { // Iterator }[, thisArg]);
@junchengdong
@junchengdong 3 жыл бұрын
@@ugurtigu I guess you cannot do such a thing in v-for, right? Because you are not really passing in an array to the tag every time.
@ugurtigu
@ugurtigu 3 жыл бұрын
@@junchengdong technically you can do {{ parentMessage }} - {{ index }} - {{ item.message }} but in this example it's a ref dunnow how you can do it then. M question though was general because I saw that often in the series that the person who made the video used not an index but the element
@junchengdong
@junchengdong 3 жыл бұрын
@@ugurtigu okay, I see. Maybe for simplicity cuz it's just a tutorial video?
@jithind-feverx2818
@jithind-feverx2818 3 жыл бұрын
Ur awesome ❤️❤️🔥🔥
@marcscherzer
@marcscherzer Жыл бұрын
37:19 If you have a mix of capital letters and small letters in names, you can convert names and search keyword to lowercase, like : const names = ref(['Mario', 'Yoshi', 'Luigi', 'Toad', 'Bowser', 'Koopa', 'Peach']); const matchingNames = computed(() => { return names.value.filter(name => name.toLowerCase().includes(search.value.toLowerCase())); }); I believe there are more effective ways to do this, but this is one of the simplest way to accomplish it imo. Feel free to share yours :)
@Defense89
@Defense89 2 жыл бұрын
wow nice course was pretty clear liked it... only one thing id like to ask i did'nt understand how come calling the function stop watching does stop watching since in the function it is watching?
@almostrandomnickname
@almostrandomnickname Жыл бұрын
great explanation.
@NetNinja
@NetNinja Жыл бұрын
Thanks Agustin!
@handsomeman5098
@handsomeman5098 2 жыл бұрын
I like your style. how you teach.
@martinfinch5011
@martinfinch5011 Жыл бұрын
Great video as always
@NetNinja
@NetNinja Жыл бұрын
Thanks Martin!
@derekbressler9154
@derekbressler9154 3 жыл бұрын
vue is the best!
@hassaniqbal6199
@hassaniqbal6199 3 жыл бұрын
agree
@derekbressler9154
@derekbressler9154 3 жыл бұрын
agree
@mod7ex_fx
@mod7ex_fx 3 жыл бұрын
thank you so much i loved your explaination , the best course out there
@NetNinja
@NetNinja 3 жыл бұрын
Thanks so much :)
@ridl27
@ridl27 3 жыл бұрын
w/ knowledge of React - vue is EZ :D
@raj.blazers
@raj.blazers Жыл бұрын
Hey Shaun, Is Vue class component with Vue property decorator is different from composition api? Which approach is best?
@TigranKuchatyan
@TigranKuchatyan 2 жыл бұрын
Great tutorial. I just wonder why initial matchingNames array should include any name, when search is empty. Anybody can help me with that? Thanks!
@aristideirie9574
@aristideirie9574 2 жыл бұрын
You are amazing, thank you so much
@NetNinja
@NetNinja 2 жыл бұрын
Thanks Aristide!
@afrazahmadkhokhar
@afrazahmadkhokhar 2 жыл бұрын
Million likes 👍
@raziyehjed362
@raziyehjed362 2 жыл бұрын
hi, I have a question, about whatEffect function when we create a function to stop the watchEfect actually it does not work because watchEffect runs when the component loads and when we push the button in order to stop it, after refreshing the page watchEfect still works, so we can not stop that unless saving in localhost, am I wrong?
@shubhang2877
@shubhang2877 3 жыл бұрын
Can you make an updated Redux tutorial? Or do you think its dead and no-one is gonna use it?
@NetNinja
@NetNinja 3 жыл бұрын
I don't think it's dead, but I don't think it's crying out for another tutorial. I will be doing an up-to-date React series very soon though. And will probably cover alternatives soon too.
@shubhang2877
@shubhang2877 3 жыл бұрын
Omg yessss. I watched both your react serieses(is that a word) and I cant wait for more :D
@noushedakib1658
@noushedakib1658 2 жыл бұрын
just awesome
@ccindy951357
@ccindy951357 9 ай бұрын
謝謝!
@NetNinja
@NetNinja 9 ай бұрын
Thanks for your support :) it means a lot!!
@frizzipazzi3600
@frizzipazzi3600 6 ай бұрын
44:30 can't i just update the reactive() nameTwo using "this.nameTwo = "Luigi" ?
@frizzipazzi3600
@frizzipazzi3600 6 ай бұрын
because it seems to work to me but im not sure if there are negative sides i can't see
@thecscontent5110
@thecscontent5110 3 жыл бұрын
I also do videos about programming!😁
@paalaleksander
@paalaleksander 2 жыл бұрын
There's no nonsense with you.. There is a few web dev teachers on youtube that knows what they talk about, but I get soooo distracted by the jokes, haircuts and stuff they come up with.
@heshanwijerathna
@heshanwijerathna 3 жыл бұрын
First commet
@_isaac_muniz_
@_isaac_muniz_ 2 жыл бұрын
Wtf we can't use primitive values with reactive... what a flaw in the framework :(
@user-kk4es3li1p
@user-kk4es3li1p 2 жыл бұрын
That's why we use ref 🤷
@AlexTheGreatish
@AlexTheGreatish 3 жыл бұрын
I only watch these videos for the classical music 🎵
@parazol123
@parazol123 2 жыл бұрын
I am using Vue for about 3 years but the Composition API is a joke. Good old Options API.
@reinoutko
@reinoutko Жыл бұрын
I dont really see the advantages this has over options, it seems to me its innovating for the sake of innovating
@Ronny-iv6kn
@Ronny-iv6kn 2 жыл бұрын
Sorry, but i want a whole playlist about 1 project
@pyplacca
@pyplacca 3 жыл бұрын
React devs learning/transitioning to Vue would really appreciate the Composition API over the Options API
@thelolladorfking2416
@thelolladorfking2416 3 жыл бұрын
Once I get my job, I'm sure I'll donate you. Thank you so much sir.
@sayemarg
@sayemarg 3 жыл бұрын
With watch(variable, (newValue, oldValue) => { }) We Can Use Variables Old And New Value On Changing In watch Function And I Think It Is More Useful Than watchEffect In Some Uses 🤔
@anandathawale609
@anandathawale609 3 жыл бұрын
Hey net ninga can I buy your merchandise form india
@lukasluftlaufer1093
@lukasluftlaufer1093 3 жыл бұрын
mind = blown!
@nguyenhuunguyeny6115
@nguyenhuunguyeny6115 3 жыл бұрын
learn any framework that you don't teach, I won't 👍👍👍
@SkipThorp
@SkipThorp 3 жыл бұрын
when I was 16 back in 1985, I had a car that had license plates with NINJA-1 on them.
@svilen001
@svilen001 3 жыл бұрын
too bad its not possible to find the code for exactly this lesson but the content is amazing and probably worth buying the full course on udemy
@tomu_sange
@tomu_sange Жыл бұрын
Why is the course price keep going high. Yesterday it was 13 but today it is 16 what is happening
@Coronerlex
@Coronerlex Жыл бұрын
I am struggling to understand the section from 16:09 to 18:18. We can't access p.value because it hasn't yet been returned? Why wasn't p returned? The setup() returns name, age, handleClick, and p. It must have returned name, age, and handleClick on page load otherwise the element wouldn't have the values for name and age initially...So then why hasn't "p" been returned at that point? Why is it not returned until handleClick is clicked?
@derekbressler9154
@derekbressler9154 3 жыл бұрын
vue is the best
@owadefelix6476
@owadefelix6476 3 жыл бұрын
You have a nice and easy way of explaining things , kudos
@bunyaminmercan5077
@bunyaminmercan5077 2 жыл бұрын
Can you teach us how to make videos, your desktop setup etc.
@Youssefchibi
@Youssefchibi 6 ай бұрын
I don't understand why we use Computed , why not just function .
@lalaland1234-s5i
@lalaland1234-s5i Ай бұрын
I think because normal functions are not reactive. You can think "computed" as "ref" function.
@ridl27
@ridl27 3 жыл бұрын
ty.
@bekchanovbotir2474
@bekchanovbotir2474 3 жыл бұрын
subtitles?
@jsnmad
@jsnmad 2 жыл бұрын
After this video, I still don't understand the case for the Composition API. I rather stick with Options API. Sometimes, we are learning new things to make no progress. So, the learning gives a net value of zero.
@reinoutko
@reinoutko Жыл бұрын
I agree
@adjiKurniaPutra
@adjiKurniaPutra 2 жыл бұрын
thankssss
@WorldRankMoba
@WorldRankMoba 2 жыл бұрын
Thanks
@DanielKaye0
@DanielKaye0 Жыл бұрын
For future reference, I believe Mario is older than Luigi 🍄😁
@NetNinja
@NetNinja Жыл бұрын
I’ll take your word for it 😁
@beaugareldimi8150
@beaugareldimi8150 Жыл бұрын
Can you do a formation vuejs but with Graphql API ? Please 🥺🥺🥺
@maskman4821
@maskman4821 3 жыл бұрын
This video is extracted from Shaun's Udemy course ~ www.udemy.com/course/build-web-apps-with-vuejs-firebase/ whick currently I am taking, it is a fabulous course, I have learned a lot, Master Ninja rocks !!!
@runehansen3105
@runehansen3105 3 жыл бұрын
What number branch does the dojo-blog project start in the github repository? I can't find it? What Lesson number is it?
@okpain8324
@okpain8324 Жыл бұрын
You are such a Goood Teacher Thanks words its not enought for thanking u . much love
@RyazantsevNikolay
@RyazantsevNikolay 2 жыл бұрын
Wonderful tutorial. Very clear and concise, way better then original Vue ones. Thanks!!!
@ricklove8358
@ricklove8358 2 жыл бұрын
u just made composition api sound like a sweet thing to me. 😊
@69leostereo
@69leostereo 2 жыл бұрын
awesme material ... please keepme in the loop.
@regolyth
@regolyth 2 жыл бұрын
Thank you, very useful
@davidadewumi8116
@davidadewumi8116 2 жыл бұрын
Thanks for this wonderful tutorial.. you're a lifesaver.. Quick question: Instead of writing: Const foo = ref('mario') And then updating the value with "foo.value" Why not just declare it as: Const foo = ref('mario').value And then you can just update it like you would a normal dynamic value
I built the same app 10 times // Which JS Framework is best?
21:58
Fireship
Рет қаралды 2,5 МЛН
Стойкость Фёдора поразила всех!
00:58
МИНУС БАЛЛ
Рет қаралды 2,7 МЛН
LIFEHACK😳 Rate our backpacks 1-10 😜🔥🎒
00:13
Diana Belitskay
Рет қаралды 3,9 МЛН
Крутой фокус + секрет! #shorts
00:10
Роман Magic
Рет қаралды 19 МЛН
Vue JS 3: Composition API vs Options API - Same App in Both!
35:44
Make Apps with Danny
Рет қаралды 28 М.
Vue.js 3 Deep Dive with Evan You
13:46
Vue Mastery
Рет қаралды 59 М.
Best Fails of the Decade | Try Not to Laugh
1:01:21
FailArmy
Рет қаралды 23 МЛН
Vue JS 3 Tutorial for Beginners #9 - Fetching Data
20:10
Net Ninja
Рет қаралды 187 М.
Vue 3 & Composition API - Full Project
1:09:15
Traversy Media
Рет қаралды 138 М.
Vue 3 Composition API Introduction [FULL TUTORIAL]
23:46
Academind
Рет қаралды 175 М.
Vue JS 3 Tutorial for Beginners #8 - The Vue Router
47:48
Net Ninja
Рет қаралды 267 М.
Стойкость Фёдора поразила всех!
00:58
МИНУС БАЛЛ
Рет қаралды 2,7 МЛН