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
jiko21
February 01, 2019
Programming
4
1.8k
TypeScriptとVue
関西Node学園#5の登壇資料です!
jiko21
February 01, 2019
Tweet
Share
More Decks by jiko21
See All by jiko21
Creating a Next.js-style Framework with Bun and Hono
jiko21
0
26
Array Grouping will soon be arriving at TypeScript
jiko21
0
34
Copying Array Methods arrived at TypeScript
jiko21
1
410
SSRで動的に OGP画像を生成したい! 〜Cloudflare Workersから@vercel/og移行編〜
jiko21
0
93
node:test will replace Jest?
jiko21
0
51
どこでも動かすために… TypeScriptでライブラリ開発の すゝめ
jiko21
2
260
NestJS a progressive web framework
jiko21
3
1.8k
レガシーなフロントエンドをリプレイスする
jiko21
5
1.4k
Deep Dive Into Vue Composition API
jiko21
0
3.2k
Other Decks in Programming
See All in Programming
TypeScriptでもLLMアプリケーション開発 / LLM Application In Typescript
rkaga
5
1.3k
Fragment Composition of GraphQL
quramy
14
1.7k
チーム立ち上げにAWSを活用したらClaudeさんに褒められた話
mkdev10
3
230
Native Federation: The Future of Micro Frontends in Angular
manfredsteyer
PRO
0
160
Jetpack Composeとデザインシステム
rmakiyama
0
220
Embedding it into Ruby code
soutaro
0
110
otelcol receiver 自作RTA / Pepabo Tech Conference #22 春のSREまつり
arthur1
0
170
Exploring Type-Informed Lint Rules in Rust based TypeScript Linters
unvalley
3
610
Node.js v22 で変わること
yosuke_furukawa
PRO
12
4.2k
AppRouter Panel Talk
yosuke_furukawa
PRO
1
520
The grand strategy of Ruby Parser
yui_knk
4
200
Effectで作る堅牢でスケーラブルなAPIゲートウェイ / Robust and Scalable API Gateway Built on Effect
yasaichi
7
1.2k
Featured
See All Featured
Practical Orchestrator
shlominoach
183
9.8k
Designing Experiences People Love
moore
136
23k
Learning to Love Humans: Emotional Interface Design
aarron
267
39k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
123
39k
What's new in Ruby 2.0
geeforr
338
31k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Debugging Ruby Performance
tmm1
70
11k
Thoughts on Productivity
jonyablonski
60
3.9k
GraphQLとの向き合い方2022年版
quramy
33
12k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Atom: Resistance is Futile
akmur
260
25k
Become a Pro
speakerdeck
PRO
13
4.6k
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 !