Vuetify Tutorial #15 - Dummy Project Data

Net Ninja · Intermediate ·🛠️ AI Tools & Apps ·7y ago

Key Takeaways

Adds dummy project data and styles rows based on status in Vuetify

Full Transcript

all right then so we have a single card right here a single Row for one single project using the grid but what I'd like to do is create some data down here and that data is going to contain a list of projects then we want to cycle through all those projects and output a different project a new card for each of those projects so let's do that down here let us first of all Define our data and this returns an object and inside this object I'm just going to paste this property called projects it's an array and you can get this off the GitHub page the link is down below and each object represents a single project it has a title it also has a person right here it also has a due date it has a status and some content which is just lauram ipsum all the way over there all right so we have all of that information on each individual project so we want to cycle through these now and output that information a new card for each one so then letters say V hyphen four on the card so we're going to Output a new card for each project and it's going to be project in projects because that's the name of our data projects so we're cycling through these now we need to bind some data to the key property and that has to be something that is unique so I'm just going to use the project. tile remember it's project because we call it a single project right here all right then so now down here we can output the data from each one of these objects so instead of hardcoding create a new website I'm going to Output project. tile which is the first property then instead of the person I'm going to Output project. person and then I'm going to down here output project and I think it's called due the property so let's have a look uh due yeah and then down here we need the status so we can output project do status so now we should get a new card for each individual project and therefore a new row for each individual project so let's save this and view it in a browser and that is looking all right to me what I'd like to do now is just add some classes to each one of these things right here so this row this layout I'm going to give a class and set that equal to something now then what I'd like to do is give this a dynamic class based on the status of each project so we have status property down here right and that status is either ongoing complete or overdue so what I'd like to do is when we're cycling through these different rows and we're outputting a new card and a new row for each individual item is give this a class for whatever status this project has so it could have a class of ongoing or of overdue or of complete so because we want to bind data here we're going to use a colon now I also want to give it a class of project as well and maybe a class to give it some padding so I can't just type in here project. status because we want to give it other classes as well so instead we're going to use an es6 template string and we do that by using back ticks like so and this means we can create a normal string but also output Dynamic variables in this string so for example if I want padding I can say PA hyphen 3 and give it that class then if I want a class of project I can do that as well but if I also want a class of this thing down here the status I can do that as well and the way we do that inside this template string is by doing a dollar sign first of all then single curly braces then the variable name so project do status like so so now each one of these is going to have a class of pa3 project and either ongoing complete or overdue so let's save that and just see what this looks like if we inspect this inside Dev tools I'm going to make this a bit bigger so we can see and move this over so now we can see each one of these if we make this a little bigger has this thing right here okay so at the minute it's not outputting the actual variable so so let's take a look at what's going wrong here and that's stupidly because I've used a percentage sign instead of the dollar so okay let's save that and go over and have a look again and now we can see this one has a class right here of ongoing if we go down to the next project and this one has a class of complete and this one has a class of complete as well and this one overdue so now they all have the own unique class and we can use that now to style each one a bit differently so for for example if I want to give this a little color on the left dependent on that class I can do we can color coordinate the status so that's what I'm going to do I'm going to come down to the bottom over here and create a style tag and inside that style I'm going to grab first of all a project because it also has a class of project then dot complete so anything with a class of project and complete and inside that I'm going to say the Border left is going to be four pixels ID and then a hex code of 3 C D1 C2 all right now I'm going to do the same thing for overdue and ongoing I'm just going to paste these though from my repo and you can see project. ongoing and project. over both have a border left of solid four pixels this one is orange and this one is tomato so we have green and orange and then tomato color so then what we're basically doing is saying okay if a project is overdue give it that overdue class and what we're going to do is give this a border left of this red color if it's ongoing it's going to have an orangey color on the border if it's complete it's going to have this green color so we're color coordinating these projects based on the actual status of it now I notice we've got some padding over here which doesn't look right so I'm going to go to the card itself and take off that class I don't think we need that padding anymore so let's save that and view it in a browser and that is looking a bit better now now I'd also like a little divider between each one of these projects so what I'm going to do at the bottom of each card is just use vyen divider to do that save that and view that and now we get that little line at the bottom as well and that is looking pretty good so now we have our project output to do this we're using a combination of data we're cycling through that using V4 right here we're giving each one of these rows a unique class right here based on the project status and styling that differently and we're using the grid system to Output that data on the screen in rows so this is looking pretty good but in the next video what I'd like to do is take a little look at chips to style these things better over here

Original Description

Hey gang, in this Vuetify tutorial we'll add some dummy project data that we can iterate over (using v-for) and output a new v-card & row for each one. We'll also style our rows a little dependent on their current status (complete, ongoing & overdue). 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 Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
2 Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
3 Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
4 GraphQL Tutorial #1 - Introduction to GraphQL
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
5 GraphQL Tutorial #2 - A Birdseye View of GraphQL
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
6 GraphQL Tutorial #3 - Project (stack) Overview
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
7 GraphQL Tutorial #4 - Making Queries (front-end preview)
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
8 GraphQL Tutorial #5 - Express App Setup
GraphQL Tutorial #5 - Express App Setup
Net Ninja
9 GraphQL Tutorial #6 - Setting up GraphQL
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
10 GraphQL Tutorial #7 - GraphQL Schema
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
11 GraphQL Tutorial #8 - Root Query
GraphQL Tutorial #8 - Root Query
Net Ninja
12 GraphQL Tutorial #9 - The Resolve Function
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
13 GraphQL Tutorial #10 - Testing Queries in Graphiql
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
14 GraphQL Tutorial #11 - GraphQL ID Type
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
15 GraphQL Tutorial #12 - Author Type
GraphQL Tutorial #12 - Author Type
Net Ninja
16 GraphQL Tutorial #13 - Type Relations
GraphQL Tutorial #13 - Type Relations
Net Ninja
17 GraphQL Tutorial #14 - GraphQL Lists
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
18 GraphQL Tutorial #15 - More on Root Queries
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
19 GraphQL Tutorial #16 - Connecting to mLab
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
20 GraphQL Tutorial #17 - Mongoose Models
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
21 GraphQL Tutorial #18 - Mutations
GraphQL Tutorial #18 - Mutations
Net Ninja
22 GraphQL Tutorial #19 - More on Mutations
GraphQL Tutorial #19 - More on Mutations
Net Ninja
23 GraphQL Tutorial #20 - Updating the Resolve Functions
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
24 GraphQL Tutorial #21 - GraphQL NonNull
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
25 GraphQL Tutorial #22 - Adding a Front-end
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
26 GraphQL Tutorial #23 - Create React App
GraphQL Tutorial #23 - Create React App
Net Ninja
27 GraphQL Tutorial #24 - Book List Component
GraphQL Tutorial #24 - Book List Component
Net Ninja
28 GraphQL Tutorial #25 - Apollo Client Setup
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
29 GraphQL Tutorial #26 - Making Queries from React
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
30 GraphQL Tutorial #27 - Rendering Data in a Component
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
31 GraphQL Tutorial #28 - Add Book Component
GraphQL Tutorial #28 - Add Book Component
Net Ninja
32 GraphQL Tutorial #29 - External Query File
GraphQL Tutorial #29 - External Query File
Net Ninja
33 GraphQL Tutorial #30 - Updating Component State
GraphQL Tutorial #30 - Updating Component State
Net Ninja
34 GraphQL Tutorial #31 - Composing Queries
GraphQL Tutorial #31 - Composing Queries
Net Ninja
35 GraphQL Tutorial #32 - query variables
GraphQL Tutorial #32 - query variables
Net Ninja
36 GraphQL Tutorial #33 - Re-fetching Queries
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
37 GraphQL Tutorial #34 - Book Details Component
GraphQL Tutorial #34 - Book Details Component
Net Ninja
38 GraphQL Tutorial #36 - Styling the App
GraphQL Tutorial #36 - Styling the App
Net Ninja
39 GraphQL Tutorial #35 - Making a Single Query
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
40 Build Apps with Vue & Firebase - Udemy Course
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
41 Updated Vue & Firebase Course (Udemy)
Updated Vue & Firebase Course (Udemy)
Net Ninja
42 Vue & Firebase Real-time Chat (Preview) #1 - Intro
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
43 Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
44 Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
45 Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
46 Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
47 Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
48 Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
49 Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
50 Object Oriented JavaScript Tutorial #1 - Introduction
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
51 Object Oriented JavaScript Tutorial #2 - Object Literals
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
52 Object Oriented JavaScript Tutorial #3 - Updating Properties
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
53 Object Oriented JavaScript Tutorial #4 - Classes
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
54 Object Oriented JavaScript Tutorial #5  - Class Constructors
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
55 Object Oriented JavaScript Tutorial #6 - Class Methods
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
56 Object Oriented JavaScript Tutorial #7 - Method Chaining
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
57 Object Oriented JavaScript Tutorial #8 - Class Inheritance
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
58 Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
59 Object Oriented JavaScript Tutorial #10 - Prototype
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
60 Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja

Related Reads

📰
Why AI Increases the Need for Platform Engineering
AI increases the need for platform engineering by generating working infrastructure code quickly, but not operational infrastructure, highlighting the importance of platform governance
Dev.to AI
📰
AI for CS Assignments: How I Survive Technical Writing (Without Completely Dreading It)
Learn how to leverage AI for technical writing in CS assignments, making the process less daunting and more efficient.
Dev.to AI
📰
I built RepoLens: a repo docs, diagrams, security report & AI chat, from one knowledge graph
Learn how to use RepoLens, a tool that generates documentation, diagrams, security reports, and AI-powered chat for any repository, and understand its applications in software development and AI-powered project analysis.
Dev.to · OnamSharma
📰
Can we use AI for academic writing? It depends:
Explore the potential of AI in academic writing and its limitations
Medium · AI
Up next
Running Account RA Bill Tutorial | Contractor Billing Software for Civil Engineers | AI Automation
The Institute of Construction Managment
Watch →