Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Nuxt.js in TypeScript
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
nunulk
January 17, 2019
Programming
460
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Nuxt.js in TypeScript
やってみた
nunulk
January 17, 2019
More Decks by nunulk
See All by nunulk
Laravelでテストしやすいコードを書く5 / 5 tips of building testable modules in Laravel
nunulk
0
350
Design It! in a nutshell
nunulk
1
310
PHP Getting Faster
nunulk
0
290
How does learning English broaden your world?
nunulk
0
420
Testing on Laravel
nunulk
1
1.6k
Vue.js + TypeScript + Firebase
nunulk
0
970
A startup meets Laravel + Vue.js
nunulk
1
2.1k
Unit Testing Laravel
nunulk
0
520
A Third-rate Programmer Talked about a Survival Strategy for Software Engineers
nunulk
3
610
Other Decks in Programming
See All in Programming
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
430
Foundry Localでエージェント開発
seosoft
0
160
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
160
Seeing Through Serverless: Observability for AWS Lambda with ADOT and CloudWatch Application Signals
seike460
PRO
1
130
AI × TiDD / 2026.09.05 Redmine 大阪
tokudiro
1
120
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
1.7k
Security issues being discussed on Web Platforms
petamoriken
0
520
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
220
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
2
270
Laravelのアプリケーションをどこにデプロイするか #ツナギメオフライン.9
akase244
0
120
[DroidKaigi 2026] Bring your own phones to Gradle Managed Devices
f2lk
0
110
高専キャリア LT 発表内容
crysta1221
6
5.6k
Featured
See All Featured
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
560
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
エンジニアに許された特別な時間の終わり
watany
108
250k
BBQ
matthewcrist
89
10k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
300
Mobile First: as difficult as doing things right
swwweet
225
10k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Transcript
Nuxt.js in TypeScript ͬͯΈͨ nunulk ΒΒͼΎ͏ʮͬͯΈͨʯറΓͷLTେձ
ࣗݾհ const name: Name = 'nunulk(͵͵Δ͘)' let job: Job
= 'ϑϦʔϥϯεͷΣϒΞϓϦέʔγϣϯΤϯδχΞ' let languages: Language[] = [ 'C/C++', ‘Java', 'PHP', ‘JavaScript', ‘TypeScript’, ] let frameworks: Framework[] = [ 'CodeIgniter', 'Symfony', 'CakePHP', ‘Laravel', ]
ຊ͢͜ͱ • Nuxt.js ͱ TypeScript ͷհ • Nuxt.js ͷ TypeScript
ରԠঢ়گ • Nuxt.js Λ TypeScript Ͱಈ͔ͯ͠ΈΔ
Nuxt.js, TypeScript ͷհ
Nuxt.js ͱ “Nuxt.js Vue ΞϓϦέʔγϣϯΛ࡞͢ΔϑϨʔϜϫʔ ΫͰ͢ɻϢχόʔαϧΞϓϦέʔγϣϯɺ੩తʹੜ͞Ε ΔΞϓϦέʔγϣϯɺγϯάϧϖʔδΞϓϦέʔγϣϯͷ த͔Β࡞͢ΔΞϓϦέʔγϣϯΛબͿ͜ͱ͕Ͱ͖·͢ɻ” -
͡Ίʹ - Nuxt.js
Nuxt.js ͱ “Nuxt.js Vue ΞϓϦέʔγϣϯΛ࡞͢ΔϑϨʔϜϫʔ ΫͰ͢ɻϢχόʔαϧΞϓϦέʔγϣϯɺ੩తʹੜ͞Ε ΔΞϓϦέʔγϣϯɺγϯάϧϖʔδΞϓϦέʔγϣϯͷ த͔Β࡞͢ΔΞϓϦέʔγϣϯΛબͿ͜ͱ͕Ͱ͖·͢ɻ” -
͡Ίʹ - Nuxt.js
Nuxt.js ͱ “Nuxt.js Vue ΞϓϦέʔγϣϯΛ࡞͢ΔϑϨʔϜϫʔ ΫͰ͢ɻϢχόʔαϧΞϓϦέʔγϣϯɺ੩తʹੜ͞Ε ΔΞϓϦέʔγϣϯɺγϯάϧϖʔδΞϓϦέʔγϣϯͷ த͔Β࡞͢ΔΞϓϦέʔγϣϯΛબͿ͜ͱ͕Ͱ͖·͢ɻ” -
͡Ίʹ - Nuxt.js
Nuxt.js ͱ • vue, vuex, vue-router, vue-server-renderer, vue-meta શ෦ೖΓ •
ϧʔςΟϯάͷࣗಈԽɺmiddleware • Vue ίϯϙʔωϯτͱ Vuex Store ͷ࣮ʹઐ೦ Ͱ͖Δ
TypeScript ͱ “TypeScript ϚΠΫϩιϑτʹΑͬͯ։ൃ͞Εɺϝϯςφϯε ͞Ε͍ͯΔϑϦʔͰΦʔϓϯιʔεͷϓϩάϥϛϯάݴޠͰ͋Δɻ TypeScriptJavaScriptʹରͯ͠ɺলུՄೳͳ੩తܕ͚ͱΫ ϥεϕʔεΦϒδΣΫτࢦΛՃ͑ͨݫີͳεʔύʔηοτͱͳͬ ͍ͯΔɻ” - Wikipedia
TypeScript ͱ “TypeScript ϚΠΫϩιϑτʹΑͬͯ։ൃ͞Εɺϝϯςφϯε ͞Ε͍ͯΔϑϦʔͰΦʔϓϯιʔεͷϓϩάϥϛϯάݴޠͰ͋Δɻ TypeScriptJavaScriptʹରͯ͠ɺলུՄೳͳ੩తܕ͚ͱΫ ϥεϕʔεΦϒδΣΫτࢦΛՃ͑ͨݫີͳεʔύʔηοτͱͳͬ ͍ͯΔɻ” - Wikipedia
TypeScript ͱ let t: [string, number] = ['Jan', 1] enum
Color { Red, Green, Blue } const c: Color = Color.Green interface Food { name: string calories: number } class Menu { items: string[] pages: number constructor(items: string[], pages: number) { this.items = items this.pages = pages } }
Nuxt.js ͷ TypeScript ରԠঢ়گ
Template
Packages • nuxt-property-decorator: vue-class- component ͷϥούʔ • vuex-class: vuex ؔ࿈ͷܕఆٛ
• axios: ඇಉظHTTP௨৴
Nuxt.js Λ TypeScript Ͱಈ͔ͯ͠ΈΔ
υϝΠϯͷܕͱ RootState ͷఆٛ export interface Task { title: string;
status: TaskStatus; } export enum TaskStatus { Open = 'open', Doing = 'doing', Closed = 'closed', } export interface RootState { tasks: Task[]; }
Vue, Decorator ͷ import <script lang="ts"> import { Vue,
Component, Prop } from 'nuxt-property-decorator' @Component({}) export default class extends Vue { @Prop() value: Task }
Store ͷ࣮ export const state = (): RootState => ({
tasks: [], }) export const mutations: MutationTree<RootState> = { setTasks(state: RootState, tasks: Task[]): void { state.tasks = tasks }, addTask(state: RootState, task: Task): void { state.tasks.push({...task}) }, } export const actions: ActionTree<RootState, RootState> = { async fetchTasks({ commit }) { const tasks: Task[] = await api.fetchTasks() commit("setTasks", tasks) } }