Completed

Vuejs Training

Jabatan Perkhidmatan Komputer Negeri Sabah

Date
18 – 22 Oct 2021
Organised by
Favourite Trainer Sdn Bhd
Trainer
Azman Zakaria
Attendees
15

Kursus ini berkonsepkan From Zero to Hero . Peserta dianggap telah mempunyai asas yang kukuh dalam pengaturcaraan Javascript, PHP dan Laravel, tetapi pemula kepada VueJs. Peserta seharusnya juga telah mempunyai asas HTML, CSS dan SQL yang baik untuk mendapat hasil sepenuhnya dari kursus ini. 

Masa Kursus:

Mula          : 9.00 AM- 10.30 AM

Rehat        : 10:31 AM - 10.45 AM

Sambung  : 10:46 AM - 1:00 PM

Makan       : 1:01 PM - 2.15 PM

Sambung  : 2.16 PM - 5:00 PM 

Perisian yang berkaitan  yang akan digunakan didalam kelas ini adalah seperti berikut :-

  • Laragon Full versi 4.0
  • PHP 8.0
  • VueJs Versi 3
  • MySQL 5.7
  • jQuery 3
  • Twitter Bootstrap 5
  • Visual Studio Code
  • SQL Yog
  • Composer
  • Cmder
  • Laravel 8

Dicadangkan PC yang akan digunakan ialah menggunakan Window 10 dengan RAM 8 Gb, dan kapasiti Storage yang Free sebanyak min 2 Gb

Syllabus

Introduction

Vuejs is a progressive framework for building user interfaces. Unlike other monolithic frameworks, Vue is designed from the ground up to be incrementally adoptable. The core library is focused on the view layer only, and is easy to pick up and integrate with other libraries or existing projects
Take your HTML, CSS & Javascript skills to the next level by learning one of the hottest Javascript frameworks available today, Vue.js!

What you will learn in this course:

  • Vuejs installation and environment setup
  • Creating template
  • Creating component
  • Component interaction
  • Component composition
  • Various sample application
  • Build to production

 

Course Duration : 3 days

Module 1.0 : Introduction & Getting Started

  1.1  Welcome
  1.2. What is Vue & why should I learn it?
  1.3. Visual Studio installation
 

Module 2.0 : Vue Basics: Guest List 

  2.1   Module intro
  2.2   Download project starter
  2.3   Installing Vue.js
  2.4   The Vue instance & the data object
  2.5   Templates & the virtual DOM
  2.6   Two way data binding with v-model
  2.7   Event handling & methods
  2.8   List rendering
  2.9   Conditional rendering in Vue
  2.10  Binding attributes to elements
  2.11  Binding styles
  2.12  Vue shorthand syntax
  2.13  Outputting text & HTML
  2.14  V-if vs v-show
  2.15  Using Javascript expressions
 

Module 3.0 : A deeper look at Vue: Guest list app

   3.1    Module intro
   3.2    Adding a progress bar
   3.3    Computed properties
   3.4    Watchers
   3.5    Key events and modifiers
   3.6    Filters
   3.7    More on looping: keys & index numbers
   3.8    Using multiple Vue instances
   3.9    Looping with objects
   3.10   Adding our navigation links & keys
   3.11   Accessing vue instances externally
   3.12  Vue instance properties & methods
   3.13  Referencing elements with ref
   3.14  Using string templates
   3.15  The Vue lifecycle
   3.16  Vue lifecycle hooks in action

Module 4.0 : Build Tools & Workflow: Creative Cards App

 4.1   Module intro
 4.2   Installing Node & NPM
 4.3   Scaffolding projects with the vue-cli
 4.4   Exploring our project layout & build tools
 4.5   Using the data object with single file templates
 

Module 5.0 : Introduction to Components: Creative Cards App

 5.1   Module intro
 5.2   What are components?
 5.3   Registering global components
 5.4   Registering local components
 5.5   Creating single file components
 5.6   Adding the card front component
 5.7   Emit data to parent components
 5.8   Dynamic components
 5.9   Creating the additional card components
 5.10  Creating the text input component
 5.11  Receiving data from the text input
 5.12  Creating the text output component
 5.13  Passing data with props
 5.14  Keeping components alive
 5.15  Scoping CSS styles
 5.16  Prop validation
 5.17  Passing prop data to a style object
 5.18  Introduction to slots
 5.19  Slot scope & fallback content
 5.20  Named slots
 

Module 6.0 : Components Continued & Firebase Storage: Creative Cards App

 6.1    Module intro
 6.2    Setting up Firebase
 6.3    Creating the Image Upload component
 6.4    Uploading images to Firebase
 6.5    Image preview thumbnail
 6.6    Upload progress bar & $emit file data
 6.7    Image Output component
 6.8.   Downloading images from Firebase
 6.9    Set image button
 6.10  Text options menu: font sizes
 6.11  Text options menu: text alignment
 6.12  Text options menu: font style & weight
 6.13  Remove image button
 6.14  Passing data with callbacks
 6.15  Making images draggable
 6.16  Finishing the CardInsideLeft component
 6.17  Finishing the CardInsideRight component
 6.18  Finishing the CardBack component
 6.19  Introduction to the event bus
 6.20  Sending events to the event bus
 6.21  Receiving events from the event bus
 6.22  Adding mixins
 

Module 7.0 : Transitions & Animations

 7.1    Module intro
 7.2    Transition classes
 7.3    Adding CSS transitions
 7.4    Adding CSS animations
 7.5    Component transitions & transition modes
 7.6    Javascript hooks introduction
 7.7    Javascript hooks in action
 7.8    Mixing animations & transitions
 7.9    Custom transition classes
 7.10  Initial render transitions
 7.11   Element transitions & keys
 7.12  Group transitions
 7.13  V-move class & dynamic transition names
 

 

Training Materials

Vue 3 Book

Vue Ninja

Gitlab Projek

Trainer Profile

 Nama : Azman bin Zakaria
 Umur : 52 tahun
 Pengalaman Dalam Bidang IT : 21 Tahun
 Syarikat : Favourite Trainer Sdn Bhd
 Kelulusan :

  • Bachelor IT UiTM
  • Diploma Computer Science UiTM
  • HRDF Certified Instructor

Azman merupakan senior programmer yang passionate dalam bidang pengaturcaraan komputer dari awal mulai beliau bekerja pada tahun 2000 sehingga hari ini. Beliau mempunyai pengalaman bekerja yang luas di agensi kerajaan, swasta dan sebagai freelancer.
Antara pengaturcaraan yang selalu digunakan adalah seperti :

  • PHP (sejak tahun 2000)
  • PHP dan Laravel Framework
  • PHP dan Yii Framework
  • Coldfusion
  • Java 
  • Java dan Spring Boot Framework
  • Javascript
  • jQuery
  • Vuejs
  • Angular
  • Flutter

 

Notes

First App With Just JavaScript

index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>A First App</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <div id="app">
      <div>
        <label for="goal">Goal</label>
        <input type="text" id="goal" />
        <button>Add Goal</button>
      </div>
      <ul>
       
      </ul>
    </div>
    <script src="app.js"></script>
  </body>
</html>


app.js

const buttonEl = document.querySelector('button');
const inputEl = document.querySelector('input');
const listEl = document.querySelector('ul');

function addGoal() {
  const enteredValue = inputEl.value;
  const listItemEl = document.createElement('li');
  listItemEl.textContent = enteredValue;
  listEl.appendChild(listItemEl);
  inputEl.value = '';
}

buttonEl.addEventListener('click', addGoal);

 

styles.css

* {
  box-sizing: border-box;
}

html {
  font-family: sans-serif;
}

body {
  margin: 0;
}

#app {
  margin: 3rem auto;
  max-width: 40rem;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
}

label, input {
  margin-bottom: 0.5rem;
  display: block;
  width: 100%;
}

label {
  font-weight: bold;
}

ul {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}

li {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #ccc;
}

 

Rebuilding The App With Vue

index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>A First App</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <div id="app">
      <div>
        <label for="goal">Goal</label>
        <input type="text" id="goal" v-model="enteredValue" />
        <button @click="addGoal()">Add Goal</button>
      </div>
      <ul>
        <li v-for="goal in goals">{{ goal }}</li>
      </ul>
    </div>
    <script src="https://unpkg.com/vue@next"></script>
    <script src="app.js"></script>
  </body>
</html>


app.js

Vue.createApp({
  data() {
    return {
      goals: [],
      enteredValue: ''
    }
  },

  methods: {
    addGoal() {
      this.goals.push(this.enteredValue);
      this.enteredValue = '';
    }
  }
}).mount('#app');

 

 

Create Vue SPA Project
------------------------
1. download install nodejs
 node --version
 npm --version
 vue --version

2. npm install -g @vue/cli

3. vue create firstapp

4. cd firstapp

5. npm run serve

6. http://localhost:8080
Vue 3 Laravel 8
----------------------------

> npm install

> npm run dev
 - compile / transpile

install vue version 3
-----------------------
> npm install vue@next
> npm install vue-loader@next
> npm install @vue/compiler-sfc

 

edit webpack.mix.js
 

mix.js('resources/js/app.js', 'public/js')

    .vue()

    .postCss('resources/css/app.css', 'public/css', [

        //

    ]);

Bootstrap installation using NPM

install bootstrap
-------------------
> npm install bootstrap@next
> npm install @popperjs/core

 

Webpack
 - npm run serve
  - webpack (babel, minified, unified)
Mix

Sail
 - Docker
 - 

> npm install

projek laraone
----------------
users
id int not null auto_increment
name var(50)
email var(50)
password var(100)
role var(25)
created_at datetime
updated_at datetime



> npm run dev OR npm run watch
 - compile / transpile

install vue version 3
-----------------------
> npm install vue@next
> npm install vue-loader@next
> npm install @vue/compiler-sfc

install bootstrap
-------------------
> npm install bootstrap@next
> npm install @popperjs/core


optional
------------------------------
- default configure utk vue version 2

> composer require laravel/ui

> php artisan ui vue

> npm install

> npm install vue-loader

> npm run dev


firstapp
- node_modules
- public
- src

larvue
- node_modules
- public
- resources/js/...


Vuejs
-------
- MPA vs SPA

Flow Pembangunan Sistem menggunakan Vue
1. sistem sedia ada (MPA)


2. new sistem (SPA)
 - full stack dev. (front-end + back-end)
 - 1 projek


3. new sistem (SPA)
 - ada dev front-end (html, vuejs, css)
 - ada dev back-end
 - 2 projek (laravel, vuejs) - micro services

 laravel : laraone
 > composer create-project --prefer-dist laravel/laravel laraone
 > php artisan serve

 vuejs : vueone
 > vue create vueone
 > cd vueone
 > npm run serve

SAPURA
- front-end + back-end
- Angular + Spring Framework (java 2 EE)


Flashback 3rd day
------------------
1. router

2. fetch data
 - jsonplaceholder.typicode

3. dynamic component
 - url tak berubah
 - tiada SEO

4. ES 6 array features
 - ... = spread operator = copy content dalam array
   const arr = [...arrLama, 1,2,3]
 - push(), unshift(), find(callback),
 - map(callback), reduce(callback), filter(callback)
 - indexOf
 - lodash (utility library)

5. <slot name="abc"></slot>
 - component wrapper
 - <the-card v-slot:abc>content</the-card>

4th Day
-------------------
Flow Pembangunan Guna Vue
 - Laravel
 - php artisan serve
 - npm run serve

Create laravel Project
- guna cli
- php -v
- composer create-project --prefer-dist laravel/laravel <nama projek>
- nama pojek = laravue




 

 

Borang Penilaian Keberkesanan Latihan

Training evaluation · Vuejs Training

Log in with the account you registered for this training to fill in the survey.

Log in to fill in the survey

Attendance

Registration closed
This training ended on 22 Oct 2021, so new attendance can no longer be registered.

Students (15)

# Name
1. MOHD AZUAN BIN RIDWAN
2. AZIEMA BINTI ABDURAHMAN
3. AZIEMA BINTI ABDURAHMAN
4. Darius Anthony Joiwin
5. Rozaime Bin Abd Rashid
6. Abdul Hadi Wathiq bin Abdul Samat
7. IAN KEVIN WITUS
8. SYAIDAHTUL BADRIYAH AZIZ
9. WAN AHMAD HAZWAN BIN AHMAD SUHAINI
10. DK. NURSAFINAH BINTI AK MOHD SAID
11. NURHAFIZA BINTI YAZULLA
12. Juraida Sappi
13. RAHIMA BINTI RUDDIN
14. ELVIN MALIH
15. Nazrin Syahiran Sabran