Vuetify Tutorial #24 - Form Basics
Key Takeaways
Creates a simple web form using Vuetify form components
Full Transcript
alright then gang so in this video I want to show you how we can start to flesh out our form in beautify now when it comes to making farms in beautify there's absolutely loads of different things that we can do really cool things as well and to cover all of that would probably take me about 30 lessons in a separate series so I'm not going to do all of that instead what I'm gonna do is get you up and running and show you how to create a couple of simple fields like a text field and a text area and in the next video as well also a date picker but if you want to learn more just check out the documentation it is really thorough and like I said there's a lot of cool things you can do with forms but let's start off basic now so let's go to the pop-up component and we already have the card title inside the card now we need the card text the actual content of the card so let's do V - card - text and inside here this is where our form is going to go now in beautifying when we're making a form we use the component first of all V - form alright now I'm going to give this a class just to give it some breathing room and that is going to be px - sorry just to give it some padding left and right in the x-direction so then first of all I want a text field so we don't use import or anything like that we use a separate component provided by beautify which is just V - text - field like so now what I'm going to do is give this a label and set that equal to title and we'll just preview this first of all in a browser so click add new project and now we can see that input field right there and if we click on it it does that nice little animation with our primary color so that's nice that's taken as one line of code right there to do and it comes baked with that functionality like so so that is our text field now what I'd like to do is store what a user types into this text field so to do that I can use a V - model and again this isn't a beauty fighting now this is just a standard view thing so V model makes allows us to sync the value of an input field with our data and we're going to set it equal to a property called - so let's place that in here title and then let's create the data down here data like so and return an object and inside this object will specify title and that's going to be an empty string to begin with so now when I use the types in here if you're typing test then we're going to be storing that on our object down here all right so that's the first one done the next one I'd like to do is the text area so we'll say this time V - and it's text area like so and this also can have a label so we'll say label is equal to and we'll just say information so information about the project so if we save that again now let's view this in a browser like so we can see this information and it's the text area so a bit deeper and we can also expand this as well and that's nice as we expand it it makes the actual pop-up bigger so that's really good okay so again I want to store what I user writes in here so we'll use a V model to do that and set that equal to info or rather I'll set it equal to content so let's store that down here as well and again this will be an empty string to begin with so now we have these two input fields now what would be nice is if we could have a little icon on the left of each one so on the left of title it could be some kind of folder like this over here and also in the information maybe a little pencil or something like that so let's do that now we don't have to use a V icon component to do this when we're using text fields of you to find knows that a lot of the time we want to prepend an icon to the text fields or the text areas or whatever input field it might be so they allow us to use a prop on these different components called prepend - icon and we set that equal to whatever the icon name is so much like we used things like folder in the nav bar or edit or whatever it is we can use that here so let me type in folder and then down here we'll do the same thing we'll prepend an icon and this one is going to be edit which is a pencil so again I got these front and material icons website not just making them up and if we save that now and view this you can see the title and the information and if we click on this again it goes purple which is really nice alright then so that's those two fields right here what I'm going to do now is just a submit field at the bottom and that is going to be a button so that at the bottom of the form will do V - BTN now this is going to be a flat button and the text is going to be ad project so ad project like so now what I'd like to do is give this a class first of all equal to success to make it that green color and also give this a class of MX 0 to strip away any margin in the X direction and MT which is the margin top 3 to give it some margin top as well save that and view it and we can see that button now at the bottom that's nice okay so we need a click event on this button so that when we click it we can take what I use it as typed in and do something with that information so down here let us create some methods I'm in these methods I want to create a method called submit and this submit method at the minute is just gonna log out the information that a user has typed in so we can say console dot log and will log out this title and also this dot content which in these two properties remember as a user types into here it's updating these properties so we're going to log those out when a user clicks on this button so we need to attach that event now so at click and set that equal to submit like so oops spell this correctly submit ok so now when we click that it's going to fire this function and log these to the console so let's just test this out so title test and hello and then it click this now if we inspect over here and open up the console then we see this error but don't worry about that we see this right here if i refresh over here then we shouldn't get that error I'm going to just add a new project and do this again test and hello submit and we get those logged to the console without the error all right so there we've gone the friends that is a very very simple form with icons to the left of these different input fields so in the next video what we'll do is a third field and that is going to be a date picker to specify the due date of this project
Original Description
Hey gang, in this Vuetify tutorial we'll look at how to create a simple web form using Vuetify form components.
VUE & FIREBASE FULL COURSE - https://www.udemy.com/build-web-apps-with-vuejs-firebase/?couponCode=NINJAYT18
Vue JS free course - https://www.youtube.com/playlist?list=PL4cUxeGkcC9gQcYgjhBoeQH7wiAyZNrYa
Vue CLI 3 tutorial - https://www.youtube.com/playlist?list=PL4cUxeGkcC9iCKx06qSncuvEPZ7x1UnKD
----------------------------------------
🐱💻 🐱💻 Course Links:
+ Course files - https://github.com/iamshaunjp/vuetify-playlist
+ VS Code editor - https://code.visualstudio.com/
🤑🤑 Donate
+ https://www.paypal.me/thenetninja
🎓🎓 Find me on Udemy
+ https://www.udemy.com/user/47fd83f6-5e4a-4e87-a0f0-519ac51f91b6/
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Net Ninja · Net Ninja · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
GraphQL Tutorial #5 - Express App Setup
Net Ninja
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
GraphQL Tutorial #8 - Root Query
Net Ninja
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
GraphQL Tutorial #12 - Author Type
Net Ninja
GraphQL Tutorial #13 - Type Relations
Net Ninja
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
GraphQL Tutorial #18 - Mutations
Net Ninja
GraphQL Tutorial #19 - More on Mutations
Net Ninja
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
GraphQL Tutorial #23 - Create React App
Net Ninja
GraphQL Tutorial #24 - Book List Component
Net Ninja
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
GraphQL Tutorial #28 - Add Book Component
Net Ninja
GraphQL Tutorial #29 - External Query File
Net Ninja
GraphQL Tutorial #30 - Updating Component State
Net Ninja
GraphQL Tutorial #31 - Composing Queries
Net Ninja
GraphQL Tutorial #32 - query variables
Net Ninja
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
GraphQL Tutorial #34 - Book Details Component
Net Ninja
GraphQL Tutorial #36 - Styling the App
Net Ninja
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
Updated Vue & Firebase Course (Udemy)
Net Ninja
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja
More on: Frontend Performance
View skill →
🎓
Tutor Explanation
DeepCamp AI