Vue JS 3 Tutorial for Beginners #7 - Forms & Inputs

Vue JS 3 Tutorial for Beginners #7 - Forms & Inputs

Net Ninja

3 года назад

175,882 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Praful Rane
Praful Rane - 11.11.2023 21:28

Anyone in 2023?

Ответить
Olamide Abass
Olamide Abass - 06.11.2023 22:17

i am very new to vue js, watched a couple of your videos and I was able to complete a vue task at work in no time. God bless you shaun.

Ответить
Mohammed M
Mohammed M - 12.10.2023 02:45

for people who face when adding .alt it's not inserting , add this line to trim the comma
this.tempSkill = this.tempSkill.replace(/,/g, ' ');

Ответить
Azam Husain
Azam Husain - 17.09.2023 17:13

watched other tutorials and the explanations are not as good. as a beginner, your tuts are the best! god bless

Ответить
Loreleï Eleanor
Loreleï Eleanor - 06.09.2023 14:55

I (and I can't stress this enough) ADORE the little music you play when you're downloading things. It makes me smile every time.

Ответить
Георги Петров
Георги Петров - 14.08.2023 20:11

for deleting I kept the div like it was and just added @click:
<div class="pill" v-for="skill in skills" :key="skill" @click="deleteSkill(skill)">
{{ skill }}
</div>

and I created my method like this(more java styled):
deleteSkill (skill) {
if (this.skills.includes(skill)) {
const pos = this.skills.indexOf(skill);
this.skills.splice(pos, 1)
}
}

maybe getting the pos first and then checking if its !=-1 or >=0 will be even faster.
By my bare knowledge my approach is faster and takes less memory, but I could be dead wrong.
Would be thankful for any feedback!

PS. Your videos are amazing and very very very helpful!

Ответить
Michael Davids
Michael Davids - 29.06.2023 18:26

I am really loving your tuts, it was the best thing I could choose to get me into working with Vue, this was a frame work I have been wanting to learn for some time. So clear and really broken down to my ding dong level.

I just want to know by you though, after doing the removeskill feature I took a different approach.

I built a function like this
removeSkill() {this.skills.pop()}

and then the @click on the span

it seems to get the job done, but I am not sure if there are any issues with this. I am not very confident in my skill set as a developer

NVM I see the fault in my stars

Ответить
Kajetan Kasprzyk
Kajetan Kasprzyk - 22.06.2023 22:21

zajebisty tutorial

Ответить
BakerCSGO
BakerCSGO - 01.04.2023 23:03

i am so thankfulf or this vue course! after a few months of casually learning react and working through multiple projects and tutorials i decided to try out Vue and its like night and day how much more it clicks with me.

P.S your a great teacher and ive been loving the challenges in this series!

Ответить
Kiran Kothandan
Kiran Kothandan - 14.03.2023 20:54

Mr Shawn you are an incredibly amazing teacher 🤩

Ответить
Bo Xu
Bo Xu - 09.02.2023 11:27

how to close the serve running on the port 8080, or do I need to close it?

Ответить
alieldeba
alieldeba - 01.02.2023 10:33

great video but i did not like the way that you remove the comma you used alt comma key if i was you i will use .replace() function to delete comma from skill without confusing the user

Ответить
push2me
push2me - 15.01.2023 22:28

Ok, let give this a wow!

Ответить
push2me
push2me - 14.01.2023 01:53

Thanks a lot Shaun! Let's give it a wow! This is teaching on Champions League level!

Ответить
Sonicastra
Sonicastra - 02.01.2023 19:39

In the section of deleting a skill, can u use this.skills.splice(skillIndex, 1); or do u have to use filter()? Ofc in the v-for i use v-for="skill, skillIndex in skills" :key="skillIndex"

Ответить
r. Wobben
r. Wobben - 30.11.2022 22:59

Where can I find the code for the lessons so I can copy the css. The link points to a totally other course with firebase

Ответить
mrsensapipe
mrsensapipe - 28.11.2022 20:56

This actually helped me a lot in my job, THANKS <3!

Ответить
Andrew M
Andrew M - 28.11.2022 04:13

Silly question here but I wasn't able to get the keyup.alt to work on a mac keyboard. Does anyone know how to do that? From what I can tell I should hold option+alt for an alt event to be triggered but it doesn't work.

Ответить
Leonardo Hirsch
Leonardo Hirsch - 14.10.2022 13:58

great tutorial, even more for a spanish speaker! Thanks

Ответить
semantixpt
semantixpt - 05.10.2022 22:03

I know I'm asking for more than I paid for, but it would be most helpful if there were hints on which GitHub's lesson is the code (namely CSS) we need to follow along. Maybe in this comments section? Thanks for all you effort, just trying to hekp everybody out there. Found the form styles at lesson 42 (binary search...).

Ответить
Andy The Dishwasher
Andy The Dishwasher - 03.10.2022 13:56

lol every time I see you misspell something, a timer starts in my head and stops when you correct it for compulsive reasons of my own. You may be pleased to know that this timer hasn't ever gone up to more than a couple of minutes. Good job, bud.

Ответить
MuriWolf ムリウルフ
MuriWolf ムリウルフ - 02.10.2022 19:42

My solution to deleteSkill:

HTML:
<div v-for="skill in skills" class="pill">
<span @click="deleteSkill(skill)">{{ skill }}</span>
</div>

JAVASCRIPT:
deleteSkill(skillToDelete) {
this.skills = this.skills.filter((skill) => skillToDelete === skill ? false : true)
}

Ответить
johnson olurotimi
johnson olurotimi - 23.09.2022 01:03

hello sir , trust you're doing good....i have a problem..... the v-for and binding key attributes prevents div from showing......without any error showing....pls how can i fix this??

Ответить
jonl316
jonl316 - 21.09.2022 07:25

Thank you, thank you, thank you!!

Ответить
Husar Munchie
Husar Munchie - 12.09.2022 16:59

Awesome tutorial so far. On deleting the skill when click I found another mthod to do so by using indexOf():
clearSkill(skill) {
// remove items in array using splice
this.skills.splice(this.skills.indexOf(skill));
Someone posted using filter is bad in vue3 because it convert Proxy{[items]} to [Proxy{item},Proxy{item}]. Can someone explain this?

Ответить
Orlando Glez
Orlando Glez - 08.09.2022 05:57

excellent explanation, tnks

Ответить
Premod suraweera
Premod suraweera - 01.09.2022 09:35

How to get github code

Ответить
Terandox
Terandox - 30.08.2022 15:39

I altered the addSkill function a bit, so i don't need to press another key than ' , ' and still don't have it in the form:
addSkill(event) {
if(event.key === ',' && this.tempSkill) {
if (!this.skills.includes(this.tempSkill.slice(0, this.tempSkill.length - 1))) {
this.skills.push(this.tempSkill.slice(0, this.tempSkill.length - 1));
}
this.tempSkill = '';
}
}

Ответить
Terandox
Terandox - 30.08.2022 15:19

Your way of removing the array element is realy creative :D
I solved this problem using "this.skills.splice(this.skills.indexOf(skill),1);"

Ответить
firas ben nasser
firas ben nasser - 16.08.2022 00:12

nothing is showing up on my localhost can anyone help?

Ответить
Majid Adigozalpour
Majid Adigozalpour - 11.08.2022 09:29

This is Vue 2 not 3, You'd better use composition API

Ответить
Marc de Ruyter
Marc de Ruyter - 21.07.2022 04:47

What is the syntax to access the form data with <script setup> ?

Ответить
andrew boddy
andrew boddy - 06.07.2022 17:59

Why use the Options API when Composition API is VUE 3 ? Saying that we can use both only adds to confusion , and will take years of messing about if there is not a conscious move to use the new structures.

(Does this video show the Composition API later ? )

Ответить
Kamal Khatib
Kamal Khatib - 06.06.2022 21:25

you can write
deleteSkill(e){
if(this.skills){
this.skills.splice(this.skills.indexOf(e.target), 1)
}
}

instead of using filter

Ответить
Ezechielpitau
Ezechielpitau - 29.05.2022 11:53

For whoever needs to hear this: Unless this is a pure hobby project that will never get released, please NEVER store the password in a database... ever

Ответить
Lewandowski Bartosz
Lewandowski Bartosz - 23.05.2022 17:51

For the sake of performance I encourage you to perform deleting of items (the challenge) like this:

<div v-for="(skill, index) in skills" :key="skill" class="pill" @click="deleteSkill(index)">

deleteSkill (skill){
this.skills.splice(skill, 1)
}

That way you don't iterate through array again and use 'index' value that already has been found during v-for loop.

Ответить
v4st
v4st - 20.05.2022 14:40

Hello,
for the "deleting skills challenge'" I just did this:
deleteSkill(e) {
this.skills.splice(this.skills.indexOf(e), 1);
}
and after that i just attached click event to the "pill" class. Nice and easy way to do it.
By the way great tutorial videos, keep it up! 👍

Ответить
Sathvik Malgikar
Sathvik Malgikar - 20.05.2022 05:08

this series is just really really simple to understand.
GreatJob!

Ответить
HerrK
HerrK - 16.05.2022 19:09

Outside of the example case, we could also use this.skills.push(this.tempSkill.slice(0, -1)) to store a skill without the coma, as "ugly" as it looks — in my case, the alt + coma makes an infinite sign.
Thanks again for the tutorial, I'm just discovering Vue before a retraining as a web developer and this is priceless !

Ответить
Success Peter
Success Peter - 10.05.2022 19:53

here is my solution for both... it quirky, but someone might refine it... if (e.key === ',' && this.tempSkill.length > 3) {
let x = this.tempSkill.slice(0, -1)
if(this.skills.indexOf(x.trim()) === -1) { //!this.skills.includes(this.tempSkill)
this.skills.push(x);
}
this.tempSkill = '';
}

Ответить
Success Peter
Success Peter - 10.05.2022 19:50

and then theres is issue of white space, someone might enter a word, then pad it with with space either in the beginning or end and still repeat the same word

Ответить