SlideShare a Scribd company logo
Quasar
Framework
By a C++ Programmer :)
Saeed Dadkhah
s4eed@outlook.com
WhatisQuasar
Whatelse
● Huge library of components
● Utilities
● Hot reloading
● Platform detection
● Great documentation and support
WhatisVue.js
● Powerful front-end JavaScript Framework
● Can be used to add functionality to existing
web pages (widgets)
● Or can be used to power an entire
SPA(Single Page Application)
● A Vue.js SPA is made up of Vue Component
Files
○ Template(For HTML)
○ Script (For data, methods, computed
properties etc)
○ Style
Quick Look at a Module
https://codesandbox.io/embed/elegant-almeida-telu9?fontsize=14&hide
navigation=1&theme=dark
FolderStructure
● src/App.vue -> Main Vue component of application
● src/layouts/MainLayout.vue -> Everything surrounds application pages
● src/pages/Index.vue
● src/components -> All of Vue components go here
● src/router/routes.js -> Assign a path to a Vue component
● src/store -> Used by Veux
Vue.js Basics
Let’s create a Todo list application ^_^
1. Remove Image from Index.vue
2. Print a message in h5 element on the page using data()
3. Save and see hot reloading :)
BindDatatotheView
TextInterpolation
1. Add an input element.
2. Use v-model to set the value of the message property.
3. Get rid of class.
4. Add padding
TwoWay DataBinding with v-model
v-modeldirective
1. Add a Clear button
2. Add click event using @click
3. Clear message text on click
4. Call a method instead of clearing directly
EventsandMethods - click
@click event
1. Add keyup event handler
2. Console.log event parameter to the handler
3. Clear the message if ESC pressed.
4. Exercise: Show an alert when Enter pressed.
5. Instead of keyup, use keyup.esc
6. Get rid of handleKeyUp function.
Events- Keyboard
@keyup event
1. Set a border for the h5 element
2. Use v-show on h5 to show/hide the element based
on the length of the message.
Showingand Hidingelements usingv-showdirective
V-show directive
1. Use v-if instead of v-show in the previous code
2. What is the difference between v-show and v-if
3. Exercise: Use v-else to show a message whenever the message is empty.
Conditional Renderingusing v-ifandv-else
V-if & v-else directives
Try to create <p> element containing upper case text of the message.
Computed Properties(1)
What’s wrong with using methods?
Try to write the previous code using a computed property..
ComputedProperties(2)
Just update the view if message changes
Add new paragraph containing the lower case of the message.
Filters
What is the difference between filters & c-properties?
In filters you just have access to the value passed to the filter function.
Filters vsComputedproperties
● In Vue.js directives start with v-
● Components can have custom directives.
1. Create autofocus directive
2. Explore more hook functions in https://vuejs.org/v2/guide/custom-directive.html
Directives
● In Vue, v-bind lets you bind an HTML attribute to a JavaScript expression.
1. Create a CSS class for error
2. Assign this CSS to the element whenever the message length is bigger than 22
characters.
Using v-bind
V-bind:class === :class
How to add more conditions and classes?
● We can use the v-for directive to render a list of items based on an array.
Displaying listswithv-for
Displaying more details
AdddeleteButton
Text
Interpolation
ChildComponents(1)
1. Create a child component named Task.vue
2. Move Task related code to Task.vue
3. Import the new Component
ChildComponents(2)
1. Use the newly imported component.
2. Check if the program is working properly
ChildComponents-PassingData tochildcomponents(3)
1. Add task prop to the Task Component.
2. Pass task as Task prop to the Task component!
3. Exercise- Pass index to the Task component.
ChildComponents-Slots(4)
1. Pass the name of the Task using slots
Let’s Create Awesome
TODO app!
Pages and Routes
1. Create new application using $>quasar create
2. Rename index page to TodoPage.vue
3. Add new page named SettingsPage.vue
4. Add routing for Settings page.
5. Add page navigation to Sidebar (Drawer)
6. Add Icons using Material.io web site.
Add Navigation for Mobile
1. Add footer to the main layout.
2. Add q-tabs component with two items in it.
3. Replace q-tab with q-route-tab
4. Use to attribute to navigate to the desired page.
5. Exercise - Use v-for to clean up the code for q-route-tab generation and drawer links.
Display tasks in a list
1. Add a checkbox enabled list to Tasks page.
2. Add completed property to task objects.
3. Add class=”q-ma-md” to the Tasks page.
4. Make q-item clickable
5. @click -> make task (un)completed.
6. Add bg-green-1 class to q-item.
VUEX
What is VUEX
● Vuex is a State management pattern + library for Vue.js applications
● Store all of our data in one, centralised place.
● Components of our app can access the data from the Store using getters
● Components of our app can change the data in the Store by triggering actions and
mutations that are contained in the store.
● Reactive - when the data in the Store changes, all components using that data will be
updated.
Deleting a task without using Vuex
Deleting a task using Vuex
Setup a Vuex store
● Adding a Vuex Module
○ $ quasar new store tasks
● Import it to storeindex.js
What are vuex parts?
single object contains all your application level state
think of them as computed properties for stores
The only way to actually change state in a Vuex store is by
committing a mutation.
Actions are similar to mutations, the differences
being that:
● Instead of mutating the state, actions commit
mutations.
● Actions can contain arbitrary asynchronous
operations.
What is namespaced: true?
Import Tasks to tasks store
store/tasks/state.js
Vue Extension
Change Task Array into an object structure
● Why?
Put task into a new child component
● Create new Component named Task.vue
● Move q-item portion of TodosPage to Task.vue
● Import Task in TodosPage
● Add task props to Task.vue
● Add id props to Task.vue
ADD NEW TASK
Add + Button to TodosPage
Add Dialog to TodosPage
Show Dialog whenever + button clicked
Move Dialog to new Component
1. Create New Child component named AddTaskDialog.vue
2. Move q-card code to this new component.
3. Import it in TodosPage.vue
4. Use it!
Add Close Button for Add Task Dialog
Design the form body
1. Add taskToSubmit data to the dialog data function
2. Add Task name input field.
3. Add Due date input field.
4. Add Due time input field.
Make Task name a required field
Implement submitTask functionality
Add Task to the store
1. Add addTask action
2. Add addTask mutation
3. Commit addTask mutation in addTaskAction
4. Use mapActions to import addTask action
Add addTask action
Add addTask mutation
Use mapActions to import addTask action

More Related Content

PDF
Introduction to Vue.js
PDF
Vue.js for beginners
PPTX
Introduction to VueJS for begginers with examples | Namspace IT
PPT
Vue.js Getting Started
PDF
Vue.js - An Introduction
PDF
Vue, vue router, vuex
PPTX
An introduction to Vue.js
PDF
VueJS Introduction
Introduction to Vue.js
Vue.js for beginners
Introduction to VueJS for begginers with examples | Namspace IT
Vue.js Getting Started
Vue.js - An Introduction
Vue, vue router, vuex
An introduction to Vue.js
VueJS Introduction

Similar to Quasar Framework Introduction for C++ develpoers (20)

PDF
Meet VueJs
PDF
Introduction to VueJS & Vuex
PDF
Vue.js 101
PDF
PDF
Vue.js
PDF
Learning Vue Directives.pdf
PPTX
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
PDF
How to Build ToDo App with Vue 3 + TypeScript
PDF
Love at first Vue
PDF
Vue js 2.x
PDF
VueJS: The Simple Revolution
PDF
ITB2019 ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 V...
PDF
Advantages of Vue JS - Presented at the Rangle.io VueJS Meetup in January
PDF
Vue fundamentasl with Testing and Vuex
PDF
Intro to VueJS Workshop
PPTX
Basics of Vue.js 2019
PPTX
Level up apps and websites with vue.js
PPTX
Level up apps and websites with vue.js
ODP
An Introduction to Vuejs
PPTX
Don't Over-React - just use Vue!
Meet VueJs
Introduction to VueJS & Vuex
Vue.js 101
Vue.js
Learning Vue Directives.pdf
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
How to Build ToDo App with Vue 3 + TypeScript
Love at first Vue
Vue js 2.x
VueJS: The Simple Revolution
ITB2019 ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 V...
Advantages of Vue JS - Presented at the Rangle.io VueJS Meetup in January
Vue fundamentasl with Testing and Vuex
Intro to VueJS Workshop
Basics of Vue.js 2019
Level up apps and websites with vue.js
Level up apps and websites with vue.js
An Introduction to Vuejs
Don't Over-React - just use Vue!
Ad

Recently uploaded (20)

PPTX
Introduction to Artificial Intelligence
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPT
Introduction Database Management System for Course Database
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Complete React Javascript Course Syllabus.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Materi-Enum-and-Record-Data-Type (1).pptx
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
System and Network Administraation Chapter 3
PPTX
Transform Your Business with a Software ERP System
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
Introduction to Artificial Intelligence
Online Work Permit System for Fast Permit Processing
Design an Analysis of Algorithms II-SECS-1021-03
L1 - Introduction to python Backend.pptx
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Which alternative to Crystal Reports is best for small or large businesses.pdf
Introduction Database Management System for Course Database
How Creative Agencies Leverage Project Management Software.pdf
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Complete React Javascript Course Syllabus.pdf
Understanding Forklifts - TECH EHS Solution
Materi-Enum-and-Record-Data-Type (1).pptx
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Upgrade and Innovation Strategies for SAP ERP Customers
PTS Company Brochure 2025 (1).pdf.......
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
System and Network Administraation Chapter 3
Transform Your Business with a Software ERP System
ManageIQ - Sprint 268 Review - Slide Deck
Ad

Quasar Framework Introduction for C++ develpoers

  • 1. Quasar Framework By a C++ Programmer :) Saeed Dadkhah [email protected]
  • 3. Whatelse ● Huge library of components ● Utilities ● Hot reloading ● Platform detection ● Great documentation and support
  • 4. WhatisVue.js ● Powerful front-end JavaScript Framework ● Can be used to add functionality to existing web pages (widgets) ● Or can be used to power an entire SPA(Single Page Application) ● A Vue.js SPA is made up of Vue Component Files ○ Template(For HTML) ○ Script (For data, methods, computed properties etc) ○ Style
  • 5. Quick Look at a Module https://codesandbox.io/embed/elegant-almeida-telu9?fontsize=14&hide navigation=1&theme=dark
  • 6. FolderStructure ● src/App.vue -> Main Vue component of application ● src/layouts/MainLayout.vue -> Everything surrounds application pages ● src/pages/Index.vue ● src/components -> All of Vue components go here ● src/router/routes.js -> Assign a path to a Vue component ● src/store -> Used by Veux
  • 7. Vue.js Basics Let’s create a Todo list application ^_^
  • 8. 1. Remove Image from Index.vue 2. Print a message in h5 element on the page using data() 3. Save and see hot reloading :) BindDatatotheView TextInterpolation
  • 9. 1. Add an input element. 2. Use v-model to set the value of the message property. 3. Get rid of class. 4. Add padding TwoWay DataBinding with v-model v-modeldirective
  • 10. 1. Add a Clear button 2. Add click event using @click 3. Clear message text on click 4. Call a method instead of clearing directly EventsandMethods - click @click event
  • 11. 1. Add keyup event handler 2. Console.log event parameter to the handler 3. Clear the message if ESC pressed. 4. Exercise: Show an alert when Enter pressed. 5. Instead of keyup, use keyup.esc 6. Get rid of handleKeyUp function. Events- Keyboard @keyup event
  • 12. 1. Set a border for the h5 element 2. Use v-show on h5 to show/hide the element based on the length of the message. Showingand Hidingelements usingv-showdirective V-show directive
  • 13. 1. Use v-if instead of v-show in the previous code 2. What is the difference between v-show and v-if 3. Exercise: Use v-else to show a message whenever the message is empty. Conditional Renderingusing v-ifandv-else V-if & v-else directives
  • 14. Try to create <p> element containing upper case text of the message. Computed Properties(1) What’s wrong with using methods?
  • 15. Try to write the previous code using a computed property.. ComputedProperties(2) Just update the view if message changes
  • 16. Add new paragraph containing the lower case of the message. Filters What is the difference between filters & c-properties?
  • 17. In filters you just have access to the value passed to the filter function. Filters vsComputedproperties
  • 18. ● In Vue.js directives start with v- ● Components can have custom directives. 1. Create autofocus directive 2. Explore more hook functions in https://vuejs.org/v2/guide/custom-directive.html Directives
  • 19. ● In Vue, v-bind lets you bind an HTML attribute to a JavaScript expression. 1. Create a CSS class for error 2. Assign this CSS to the element whenever the message length is bigger than 22 characters. Using v-bind V-bind:class === :class How to add more conditions and classes?
  • 20. ● We can use the v-for directive to render a list of items based on an array. Displaying listswithv-for
  • 23. ChildComponents(1) 1. Create a child component named Task.vue 2. Move Task related code to Task.vue 3. Import the new Component
  • 24. ChildComponents(2) 1. Use the newly imported component. 2. Check if the program is working properly
  • 25. ChildComponents-PassingData tochildcomponents(3) 1. Add task prop to the Task Component. 2. Pass task as Task prop to the Task component! 3. Exercise- Pass index to the Task component.
  • 26. ChildComponents-Slots(4) 1. Pass the name of the Task using slots
  • 28. Pages and Routes 1. Create new application using $>quasar create 2. Rename index page to TodoPage.vue 3. Add new page named SettingsPage.vue 4. Add routing for Settings page. 5. Add page navigation to Sidebar (Drawer) 6. Add Icons using Material.io web site.
  • 29. Add Navigation for Mobile 1. Add footer to the main layout. 2. Add q-tabs component with two items in it. 3. Replace q-tab with q-route-tab 4. Use to attribute to navigate to the desired page. 5. Exercise - Use v-for to clean up the code for q-route-tab generation and drawer links.
  • 30. Display tasks in a list 1. Add a checkbox enabled list to Tasks page. 2. Add completed property to task objects. 3. Add class=”q-ma-md” to the Tasks page. 4. Make q-item clickable 5. @click -> make task (un)completed. 6. Add bg-green-1 class to q-item.
  • 31. VUEX
  • 32. What is VUEX ● Vuex is a State management pattern + library for Vue.js applications ● Store all of our data in one, centralised place. ● Components of our app can access the data from the Store using getters ● Components of our app can change the data in the Store by triggering actions and mutations that are contained in the store. ● Reactive - when the data in the Store changes, all components using that data will be updated.
  • 33. Deleting a task without using Vuex
  • 34. Deleting a task using Vuex
  • 35. Setup a Vuex store ● Adding a Vuex Module ○ $ quasar new store tasks ● Import it to storeindex.js
  • 36. What are vuex parts? single object contains all your application level state think of them as computed properties for stores The only way to actually change state in a Vuex store is by committing a mutation. Actions are similar to mutations, the differences being that: ● Instead of mutating the state, actions commit mutations. ● Actions can contain arbitrary asynchronous operations. What is namespaced: true?
  • 37. Import Tasks to tasks store store/tasks/state.js Vue Extension
  • 38. Change Task Array into an object structure ● Why?
  • 39. Put task into a new child component ● Create new Component named Task.vue ● Move q-item portion of TodosPage to Task.vue ● Import Task in TodosPage ● Add task props to Task.vue ● Add id props to Task.vue
  • 41. Add + Button to TodosPage
  • 42. Add Dialog to TodosPage
  • 43. Show Dialog whenever + button clicked
  • 44. Move Dialog to new Component 1. Create New Child component named AddTaskDialog.vue 2. Move q-card code to this new component. 3. Import it in TodosPage.vue 4. Use it!
  • 45. Add Close Button for Add Task Dialog
  • 46. Design the form body 1. Add taskToSubmit data to the dialog data function 2. Add Task name input field. 3. Add Due date input field. 4. Add Due time input field.
  • 47. Make Task name a required field
  • 49. Add Task to the store 1. Add addTask action 2. Add addTask mutation 3. Commit addTask mutation in addTaskAction 4. Use mapActions to import addTask action
  • 52. Use mapActions to import addTask action