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
おさらいVue Composition API
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
texdeath
November 21, 2019
Programming
500
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
おさらいVue Composition API
Vue3.xのRFCに導入されるVue Composition APIの紹介です。
texdeath
November 21, 2019
More Decks by texdeath
See All by texdeath
コードメトリクス計測による課題可視化と品質確保 / Visualize issues and ensure quality by measuring code metrics
texdeath
0
430
クライアントワークと管理画面の話
texdeath
0
320
次世代ヘッドレス開発室が提供するヘッドレスEC
texdeath
0
680
中期プロジェクトで e2eテストを導入してみて感じたこと
texdeath
2
8k
React使いがVueと仲良くなるためにやったこと
texdeath
0
310
Optional Chainingについて
texdeath
3
220
副業として個人事業主をやる場合の メリット・デメリット
texdeath
0
130
Container Componentは必要なのか
texdeath
4
680
Kotlin/JSでReactアプリを作ってみた
texdeath
1
970
Other Decks in Programming
See All in Programming
Hono + Inertia + React で LP を構築した話
oukayuka
2
150
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
510
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
180
170k Jobs a Day on GKE: Scaling Mercari's CI Platform - and What's Next for AI-Native Development
junyaokabe
0
120
源内ハンズオン概要編
hideg
0
210
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
540
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
250
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
400
Webエンジニアなのにブラウザの仕組みがわからないので、Pythonで自作してみた
tatsuki12
4
1k
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
250
Dockerfile CMD for Node.js
grazie1999
0
120
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
19k
Featured
See All Featured
Mind Mapping
helmedeiros
PRO
1
330
Design in an AI World
tapps
1
290
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Designing Experiences People Love
moore
143
24k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
470
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
500
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
470
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
340
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
210
My Coaching Mixtape
mlcsv
0
270
Transcript
͓͞Β͍ 7VF$PNQPTJUJPO"1* 1
๏ ాɹউॣ ๏ ϑϩϯτΤϯυΤϯδχΞ ๏ 3FBDU/PEF7VF /VYU ๏ 7VFྺϲ݄ͪΐ͍͘Β͍
๏ 5XJUUFS!UFYEFBUI 2
Agenda 1. What is Vue Composition API? 2. Better Type
Interface 3. Logic Extraction and Reuse 4. More Flexibility Requires More Discipline 5. まとめ 3
What is Vue Composition API Vue 3.xからRFCで組み込まれる関数ベースのAPI ロジックの再利用性を高め、より柔軟な構築を可能にする 4
جຊతͳྫ 5
جຊతͳྫ 6 ͜ͷؔ෦ͰσʔλؔͷఆٛΛߦ͏
جຊతͳྫ 7 ঢ়ଶͷએݴ ͜ͷؔ෦ͰσʔλؔͷఆٛΛߦ͏
جຊతͳྫ 8 ঢ়ଶͷએݴ ͜ͷؔ෦ͰσʔλؔͷఆٛΛߦ͏ ܭࢉͨ͠ঢ়ଶʢࢀরʣΛฦ͢
Better Type Interface TypeScriptへのサポートが大幅に向上 CreateComponentを定義すると型推論が効くようになる 9 import { createComponent }
from '@vue/composition-api'; const Component = createComponent({ // ͜ͷ෦Ͱܕਪ͕ޮ͘Α͏ʹͳΔ }); const Component = { // ͪ͜ΒͷίϯϙʔωϯτมͰܕਪ͕ޮ͔ͳ͍ // ʢTypeScript͕VueͷίϯϙʔωϯτͰ͋ΔͱஅͰ͖ͳ͍ͨΊʣ };
Logic Extraction and Reuse 関数化することで、任意の機能再利用が容易に 10
More Flexibility Requires More Discipline • 柔軟性を高めるためには、多くの規律が必要 • 適切に運用しないと品質は大きく下がってしまう •
VuexやRouterを組み合わせるとより難易度が上がる • JavaScriptのコアメカニズムに則った編成を心がける 11
ެࣜͷνϡʔτϦΞϧಈը͕Θ͔Γ͍͢ 12 https://www.vuemastery.com/courses/vue-3-essentials/why-the-composition-api/
·ͱΊ •Vue Composition APIを使えば •関数化が楽になる •TypeScriptでの型推論がしやすくなる •柔軟な構築が可能だが、それゆえより高度 な設計が必要 13