SlideShare a Scribd company logo
http://techmaster.vn
Giới thiệu Nuxt.js
Đặng Quang Huy, robin@techmaster.vn
http://techmaster.vn
Nội dung
1. Nuxt.js là gì ?
2. Tính năng nổi bật của Nuxt.js
3. Demo ứng dụng đơn giản bằng Nuxt.js
http://techmaster.vn
Nuxt.js là gì ?
http://techmaster.vn
Nuxt.js là gì ?
• Là một frame work để tạo ra một
Universal Vue.js Applications.
• Nuxt.js đã được cấu hình sẵn những
thứ cần thiết để giúp cho việc phát triển ứng dụng
được dễ dàng hơn.
http://techmaster.vn
Universal Vue.js Applications
• Là ứng dụng được viết bằng Vue.js.
• Có thể chạy được cả ở trên server lẫn client.
http://techmaster.vn
Website truyền thống
http://techmaster.vn
Website truyền thống
• Toàn bộ phần xử lý dữ liệu, render View được thực
hiện phía server (Server side rendering).
• Theo kiến trúc monolithic, phù hợp với các ứng
dụng vừa và nhỏ, có giao diện không quá phức tạp.
http://techmaster.vn
Single Page App
http://techmaster.vn
Single Page App (SSR)
• Chỉ xử lý phần giao diện, tách biệt ra khỏi code
backend nên dễ dàng xây dựng các ứng dụng có giao
diện phức tạp, có nhiều tương tác với người dùng.
• Khó SEO do dữ liệu được cập nhật bằng Javascript
chứ không được render sẵn.
http://techmaster.vn
Universal App
• Kết hợp giữa SSR và SPA.
• Hỗ trợ SEO tốt.
• Tách biệt được phần View và phần xử lý dữ liệu
(thích hợp với kiến trúc micro service).
http://techmaster.vn
Tính năng nổi bật của Nuxt.js
http://techmaster.vn
Cấu trúc thư mục rõ ràng
• Viết code Vue.js trên các file .vue.
• Chia website ra nhiều trang (pages), mỗi
pages là một file riêng.
• Chia layouts, components, plugins, … giúp
code dễ bảo trì và tái sử dụng.
http://techmaster.vn
SSR & Routing system
• Hỗ trợ SSR bằng cách cung cấp một số hàm để thao
tác khi lấy dữ liệu, render view, … mà không cần biết
về code backend (sử dụng Node.js).
• Routing theo convention là tên file, hỗ trợ dynamic
routes, nested routes, … (sử dụng vue-router).
http://techmaster.vn
Transpilation, bundling & minifying
• Biên dịch code ES6/ES7 để có thể chạy được trên các
trình duyệt chưa hỗ trợ (sử dụng Babel).
• Bundling & minifying code HTML, CSS & JS (sử dụng
webpack và một số thư viện đi kèm).
http://techmaster.vn
Và nhiều tính năng khác
• Automatic code splitting: Chia nhỏ code, chỉ load những
phần mà trang cần dùng đến để cải thiện performance.
• Quản lý nội dung thẻ <head> hỗ trợ SEO tốt hơn.
• Hot reload trong môi trường development.
• …
http://techmaster.vn
Demo ứng dụng đơn giản bằng
Nuxt.js
http://techmaster.vn
Khởi tạo project
Download file .zip starter template hoặc cài bằng
vue-cli:
vue init nuxt-community/starter-template <project-name>
http://techmaster.vn
Chạy project
• Cài dependencies:
$ cd <project-name>
$ npm install
• Chạy môi trường dev bằng lệnh:
$ npm run dev
http://techmaster.vn
Kết quả
Website sẽ chạy ở địa chỉ http://localhost:3000
http://techmaster.vn
Tham khảo
• Trang chủ: https://nuxtjs.org/
• Mã nguồn: https://github.com/nuxt/nuxt.js
• Một vài thư viện, tutorial, example về nuxt:
https://github.com/nuxt-community/awesome-nuxt

More Related Content

What's hot

Rà soát Malware bằng SysInternal Suite
Rà soát Malware bằng SysInternal SuiteRà soát Malware bằng SysInternal Suite
Rà soát Malware bằng SysInternal Suite
Phạm Trung Đức
 
Présentation SOA
Présentation SOAPrésentation SOA
Présentation SOA
Cynapsys It Hotspot
 
Bài Giảng Môn Học Cơ Sở Dữ Liệu Nâng Cao
Bài Giảng Môn Học Cơ Sở Dữ Liệu Nâng Cao Bài Giảng Môn Học Cơ Sở Dữ Liệu Nâng Cao
Bài Giảng Môn Học Cơ Sở Dữ Liệu Nâng Cao
nataliej4
 
An Introduction to Vuejs
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to Vuejs
Paddy Lock
 
Bao cao wesite bán giày.docx
Bao cao wesite bán giày.docxBao cao wesite bán giày.docx
Bao cao wesite bán giày.docx
ssuser11005a
 
Lưu trữ và xử lý dữ liệu trong điện toán đám mây
Lưu trữ và xử lý dữ liệu trong điện toán đám mâyLưu trữ và xử lý dữ liệu trong điện toán đám mây
Lưu trữ và xử lý dữ liệu trong điện toán đám mây
PhamTuanKhiem
 
Support de cours angular
Support de cours angularSupport de cours angular
Support de cours angular
ENSET, Université Hassan II Casablanca
 
Mô Hình MVC 3.0
Mô Hình MVC 3.0Mô Hình MVC 3.0
Mô Hình MVC 3.0
David Nguyen
 
Bài 2 Cài đặt Windows Server 2008 - Giáo trình FPT
Bài 2 Cài đặt Windows Server 2008 - Giáo trình FPTBài 2 Cài đặt Windows Server 2008 - Giáo trình FPT
Bài 2 Cài đặt Windows Server 2008 - Giáo trình FPT
MasterCode.vn
 
Microservices avec Spring Cloud
Microservices avec Spring CloudMicroservices avec Spring Cloud
Microservices avec Spring Cloud
Florian Beaufumé
 
Node js crash course session 1
Node js crash course   session 1Node js crash course   session 1
Node js crash course session 1
Abdul Rahman Masri Attal
 
Nghiên cứu một số hình thức tấn công website phổ biến và các giải pháp phòng ...
Nghiên cứu một số hình thức tấn công website phổ biến và các giải pháp phòng ...Nghiên cứu một số hình thức tấn công website phổ biến và các giải pháp phòng ...
Nghiên cứu một số hình thức tấn công website phổ biến và các giải pháp phòng ...
Thịt Xốt Cà Chua
 
Tìm hiểu MongoDB
Tìm hiểu MongoDBTìm hiểu MongoDB
Tìm hiểu MongoDB
Trung Hiếu Trần
 
Introduction à Angular
Introduction à AngularIntroduction à Angular
Introduction à Angular
Abdoulaye Dieng
 
Design Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVMDesign Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVM
Mudasir Qazi
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
MahmoudZidan41
 
Vue, vue router, vuex
Vue, vue router, vuexVue, vue router, vuex
Vue, vue router, vuex
Samundra khatri
 
Bài 3: Triển khai dịch vụ Active Directory - Giáo trình FPT
Bài 3: Triển khai dịch vụ Active Directory - Giáo trình FPTBài 3: Triển khai dịch vụ Active Directory - Giáo trình FPT
Bài 3: Triển khai dịch vụ Active Directory - Giáo trình FPT
MasterCode.vn
 
MongoDB Introduction
MongoDB IntroductionMongoDB Introduction
MongoDB Introduction
thanh can
 

What's hot (20)

Rà soát Malware bằng SysInternal Suite
Rà soát Malware bằng SysInternal SuiteRà soát Malware bằng SysInternal Suite
Rà soát Malware bằng SysInternal Suite
 
Présentation SOA
Présentation SOAPrésentation SOA
Présentation SOA
 
Bài Giảng Môn Học Cơ Sở Dữ Liệu Nâng Cao
Bài Giảng Môn Học Cơ Sở Dữ Liệu Nâng Cao Bài Giảng Môn Học Cơ Sở Dữ Liệu Nâng Cao
Bài Giảng Môn Học Cơ Sở Dữ Liệu Nâng Cao
 
An Introduction to Vuejs
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to Vuejs
 
Bao cao wesite bán giày.docx
Bao cao wesite bán giày.docxBao cao wesite bán giày.docx
Bao cao wesite bán giày.docx
 
Lưu trữ và xử lý dữ liệu trong điện toán đám mây
Lưu trữ và xử lý dữ liệu trong điện toán đám mâyLưu trữ và xử lý dữ liệu trong điện toán đám mây
Lưu trữ và xử lý dữ liệu trong điện toán đám mây
 
Support de cours angular
Support de cours angularSupport de cours angular
Support de cours angular
 
Mô Hình MVC 3.0
Mô Hình MVC 3.0Mô Hình MVC 3.0
Mô Hình MVC 3.0
 
Bài 2 Cài đặt Windows Server 2008 - Giáo trình FPT
Bài 2 Cài đặt Windows Server 2008 - Giáo trình FPTBài 2 Cài đặt Windows Server 2008 - Giáo trình FPT
Bài 2 Cài đặt Windows Server 2008 - Giáo trình FPT
 
Microservices avec Spring Cloud
Microservices avec Spring CloudMicroservices avec Spring Cloud
Microservices avec Spring Cloud
 
Node js crash course session 1
Node js crash course   session 1Node js crash course   session 1
Node js crash course session 1
 
Nghiên cứu một số hình thức tấn công website phổ biến và các giải pháp phòng ...
Nghiên cứu một số hình thức tấn công website phổ biến và các giải pháp phòng ...Nghiên cứu một số hình thức tấn công website phổ biến và các giải pháp phòng ...
Nghiên cứu một số hình thức tấn công website phổ biến và các giải pháp phòng ...
 
Tìm hiểu MongoDB
Tìm hiểu MongoDBTìm hiểu MongoDB
Tìm hiểu MongoDB
 
Introduction à Angular
Introduction à AngularIntroduction à Angular
Introduction à Angular
 
Design Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVMDesign Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVM
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Vue, vue router, vuex
Vue, vue router, vuexVue, vue router, vuex
Vue, vue router, vuex
 
Bài 3: Triển khai dịch vụ Active Directory - Giáo trình FPT
Bài 3: Triển khai dịch vụ Active Directory - Giáo trình FPTBài 3: Triển khai dịch vụ Active Directory - Giáo trình FPT
Bài 3: Triển khai dịch vụ Active Directory - Giáo trình FPT
 
Ansible tp
Ansible tpAnsible tp
Ansible tp
 
MongoDB Introduction
MongoDB IntroductionMongoDB Introduction
MongoDB Introduction
 

Similar to Giới thiệu Nuxt.js

ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015
ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015
ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015
IT Expert Club
 
Arrowjs.io
Arrowjs.ioArrowjs.io
Arrowjs.io
TechMaster Vietnam
 
Giới thiệu ASP.NET Core 2.0
Giới thiệu ASP.NET Core 2.0Giới thiệu ASP.NET Core 2.0
Giới thiệu ASP.NET Core 2.0
Huân Bùi Đình
 
giới thiệu về Asp.net core 2.0
giới thiệu về Asp.net core  2.0giới thiệu về Asp.net core  2.0
giới thiệu về Asp.net core 2.0
VanSy9x
 
Nodejs Introduction
Nodejs IntroductionNodejs Introduction
Nodejs Introduction
thanh can
 
Sof301 slide1
Sof301   slide1Sof301   slide1
Sof301 slide1
tonguyencntt
 
Php day 2011 - Nukeviet
Php day 2011 -  NukevietPhp day 2011 -  Nukeviet
Php day 2011 - NukevietQuang Anh Le
 
Tìm hiểu về NodeJs
Tìm hiểu về NodeJsTìm hiểu về NodeJs
Tìm hiểu về NodeJs
Bình Trọng Án
 
Node.js căn bản
Node.js căn bảnNode.js căn bản
Node.js căn bản
TechMaster Vietnam
 
Thuyet trinh java fx
Thuyet trinh java fxThuyet trinh java fx
Thuyet trinh java fx
Huu Uoc Nguyen
 
Cac bai tap .net
Cac bai tap .netCac bai tap .net
Cac bai tap .net
kevinpham123
 
Tổng quan ASP.NET CORE - NIVIKI.COM
Tổng quan ASP.NET CORE - NIVIKI.COMTổng quan ASP.NET CORE - NIVIKI.COM
Tổng quan ASP.NET CORE - NIVIKI.COM
Khoa Nguyen
 
Gioi thieu-va-mo-ta-chi-tiet-tinh-nang-nuke viet
Gioi thieu-va-mo-ta-chi-tiet-tinh-nang-nuke vietGioi thieu-va-mo-ta-chi-tiet-tinh-nang-nuke viet
Gioi thieu-va-mo-ta-chi-tiet-tinh-nang-nuke vietHoang Ty
 
Devexpress cho asp.net
Devexpress cho asp.netDevexpress cho asp.net
Devexpress cho asp.net
thichxoidau
 
02 phan-thai-trung-drupal
02 phan-thai-trung-drupal02 phan-thai-trung-drupal
02 phan-thai-trung-drupalhazzaz
 
Giáo trình asp.net với c sharp
Giáo trình asp.net với c sharpGiáo trình asp.net với c sharp
Giáo trình asp.net với c sharp
Trần Văn Sáng Trần
 
Pham Anh Tu - TK Framework
Pham Anh Tu - TK FrameworkPham Anh Tu - TK Framework
Pham Anh Tu - TK Framework
Vu Hung Nguyen
 
Tu hoc microsoft asp.net
Tu hoc microsoft asp.netTu hoc microsoft asp.net
Tu hoc microsoft asp.netnamhh1984ag
 
Giới thiệu NukeViet 5 và Autoweb
Giới thiệu NukeViet 5 và AutowebGiới thiệu NukeViet 5 và Autoweb
Giới thiệu NukeViet 5 và Autoweb
vinades
 
Hanoi php day 2008 - 02. phan thai trung - drupal
Hanoi php day 2008 - 02. phan thai trung - drupalHanoi php day 2008 - 02. phan thai trung - drupal
Hanoi php day 2008 - 02. phan thai trung - drupalNguyen Duc Phu
 

Similar to Giới thiệu Nuxt.js (20)

ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015
ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015
ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015
 
Arrowjs.io
Arrowjs.ioArrowjs.io
Arrowjs.io
 
Giới thiệu ASP.NET Core 2.0
Giới thiệu ASP.NET Core 2.0Giới thiệu ASP.NET Core 2.0
Giới thiệu ASP.NET Core 2.0
 
giới thiệu về Asp.net core 2.0
giới thiệu về Asp.net core  2.0giới thiệu về Asp.net core  2.0
giới thiệu về Asp.net core 2.0
 
Nodejs Introduction
Nodejs IntroductionNodejs Introduction
Nodejs Introduction
 
Sof301 slide1
Sof301   slide1Sof301   slide1
Sof301 slide1
 
Php day 2011 - Nukeviet
Php day 2011 -  NukevietPhp day 2011 -  Nukeviet
Php day 2011 - Nukeviet
 
Tìm hiểu về NodeJs
Tìm hiểu về NodeJsTìm hiểu về NodeJs
Tìm hiểu về NodeJs
 
Node.js căn bản
Node.js căn bảnNode.js căn bản
Node.js căn bản
 
Thuyet trinh java fx
Thuyet trinh java fxThuyet trinh java fx
Thuyet trinh java fx
 
Cac bai tap .net
Cac bai tap .netCac bai tap .net
Cac bai tap .net
 
Tổng quan ASP.NET CORE - NIVIKI.COM
Tổng quan ASP.NET CORE - NIVIKI.COMTổng quan ASP.NET CORE - NIVIKI.COM
Tổng quan ASP.NET CORE - NIVIKI.COM
 
Gioi thieu-va-mo-ta-chi-tiet-tinh-nang-nuke viet
Gioi thieu-va-mo-ta-chi-tiet-tinh-nang-nuke vietGioi thieu-va-mo-ta-chi-tiet-tinh-nang-nuke viet
Gioi thieu-va-mo-ta-chi-tiet-tinh-nang-nuke viet
 
Devexpress cho asp.net
Devexpress cho asp.netDevexpress cho asp.net
Devexpress cho asp.net
 
02 phan-thai-trung-drupal
02 phan-thai-trung-drupal02 phan-thai-trung-drupal
02 phan-thai-trung-drupal
 
Giáo trình asp.net với c sharp
Giáo trình asp.net với c sharpGiáo trình asp.net với c sharp
Giáo trình asp.net với c sharp
 
Pham Anh Tu - TK Framework
Pham Anh Tu - TK FrameworkPham Anh Tu - TK Framework
Pham Anh Tu - TK Framework
 
Tu hoc microsoft asp.net
Tu hoc microsoft asp.netTu hoc microsoft asp.net
Tu hoc microsoft asp.net
 
Giới thiệu NukeViet 5 và Autoweb
Giới thiệu NukeViet 5 và AutowebGiới thiệu NukeViet 5 và Autoweb
Giới thiệu NukeViet 5 và Autoweb
 
Hanoi php day 2008 - 02. phan thai trung - drupal
Hanoi php day 2008 - 02. phan thai trung - drupalHanoi php day 2008 - 02. phan thai trung - drupal
Hanoi php day 2008 - 02. phan thai trung - drupal
 

Giới thiệu Nuxt.js