Vuejs Training
Jabatan Perkhidmatan Komputer Negeri Sabah

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 What you will learn in this course:
Course Duration : 3 days |
Module 1.0 : Introduction & Getting Started 1.1 Welcome Module 2.0 : Vue Basics: Guest List 2.1 Module intro Module 3.0 : A deeper look at Vue: Guest list app 3.1 Module intro |
Module 4.0 : Build Tools & Workflow: Creative Cards App 4.1 Module intro Module 5.0 : Introduction to Components: Creative Cards App 5.1 Module intro |
Module 6.0 : Components Continued & Firebase Storage: Creative Cards App 6.1 Module intro Module 7.0 : Transitions & Animations 7.1 Module intro |
Trainer Profile
![]() |
Nama : Azman bin Zakaria
|
|
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.
|
|
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 surveyAttendance
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 |
