Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
TypeScriptとVue
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
jiko21
February 01, 2019
Programming
1.9k
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TypeScriptとVue
関西Node学園#5の登壇資料です!
jiko21
February 01, 2019
More Decks by jiko21
See All by jiko21
型情報を手繰り寄せる技術~TypeScript Compiler APIによる型解析実践~
jiko21
0
1.2k
Creating a Next.js-style Framework with Bun and Hono
jiko21
0
180
Array Grouping will soon be arriving at TypeScript
jiko21
0
170
Copying Array Methods arrived at TypeScript
jiko21
1
900
SSRで動的に OGP画像を生成したい! 〜Cloudflare Workersから@vercel/og移行編〜
jiko21
0
170
node:test will replace Jest?
jiko21
0
120
どこでも動かすために… TypeScriptでライブラリ開発の すゝめ
jiko21
2
450
NestJS a progressive web framework
jiko21
3
2.3k
レガシーなフロントエンドをリプレイスする
jiko21
5
1.6k
Other Decks in Programming
See All in Programming
さぁV100、メモリをお食べ・・・
nilpe
0
150
Creating Composable Callables in Contemporary C++
rollbear
0
160
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.4k
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
150
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
280
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
610
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
180
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
300
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.5k
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
140
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
2
720
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9.4k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Everyday Curiosity
cassininazir
0
240
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.1k
Building an army of robots
kneath
306
46k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
400
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
630
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
480
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
190
Typedesign – Prime Four
hannesfritz
42
3.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
Transcript
TypeScript Vue @Daikids2
H G (Daiki Kojima) • 2 JG N • P
), • : 2 , : • 2 FDC • @ 2 • ( ) :
https://bit.ly/2MQ1qLL !!
Topics… • Vue • TypeScript •
Vue TypeScript …
Vue
… • vue-clideprecated (#"&) ! • !%$ vue+vuex
… • ! npm install -g @vue/cli
vue-cli • $"! ! • TypeScriptscss
• $" #% • ! • Class Component… • UI mode …
UI mode... • UI( ) !
vue-cli • $"! ! • TypeScriptscss
• $" #% • ! • Class Component… • UI mode …
TypeScript …
TypeScript?
TypeScript? • MicrosoftaltJS • • •
Interface(Java ) • …
• JS => •
TypeScript !
• addmul
function add (a, b) { return a + b; } function mul (a, b) { return a * b; } const a = 1; const b = "string"; add(a, b); mul(a, b); [Node2019]
… • add(a, b): ‘1string’() • 1string • mul(a,
b): ‘NaN’ () • 1 * ‘string’ …
• b addmul
function add (a, b) { return a + b; } function mul (a, b) { return a * b; } const a = 1; const b = ”1"; add(a, b); mul(a, b); [Node2019]
… • add(a, b): ‘11’() • 1string • mul(a, b):
1 • 1 number ! • !
! … • add(a, b): ‘11’() • 1string • mul(a,
b): 1 • 1 number ! • !
… • string !
function add(a: number, b: number): number { return a + b; } function mul(a: number, b: number): number { return a * b; } const a = 1; const b = "1"; console.log(add(a, b)); console.log(mul(a, b));
Interface • Javainterface +1 . / • Java*()%!'$ ,
TypeScript, • “ %!'$&"#$0- ?” !
Interface interface Hoge { firstName: string, lastName: string, action: ()
=> void,// }; const hoge: Hoge = { firstName: 'Daiki’, lastName: 'Kojima’, action: () => { console.log('hogehoge’); }, }; function doHoge(hoge: Hoge) { hoge.action(); } doHoge(hoge);// hogehoge
VueTypeScript …
… https://jp.vuejs.org/v2/guide/typescript.html
… • TypeScript Vue !!
!!
1: class-style component syntax • Vue: • Object
! • Class-style Vue: • !! • Class-style TypeScript! ()
<script> export default { name: 'HelloWorld’, props: { msg:
String } } </script>
Class-Style… <script> @Component export default class HelloWorld extends Vue {
@Prop() private msg!: string; } </script>
• TypeScript ! • Component String, Number
Vue …
Interface • Props • @Component({ props: {
members: { type: Object as () => Member[] }, }, })
Class Style… • … @Component export default class MemberList
extends Vue { @Prop() private members!: Member[] }
Vuex ?
• Tree<> vuex Store ! • Vuexmodule
!
Action… • Action"(Interface) ! • #
! !! doSignin({ commit }, userInfo: SigninForm) { services.singInWithUser(userInfo, (user: firebase.User) => { _procToken(commit, user); }); },
Mutation… • ! !! • StateComponent
Props ! getMembers(state: State): Member[] { return state.members; },
…
… • Vue TypeScript
• Class-Style Component!
TypeScript !