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
texdeath
November 21, 2019
Programming
490
0
Share
おさらい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
370
クライアントワークと管理画面の話
texdeath
0
280
次世代ヘッドレス開発室が提供するヘッドレスEC
texdeath
0
670
中期プロジェクトで e2eテストを導入してみて感じたこと
texdeath
2
7.9k
React使いがVueと仲良くなるためにやったこと
texdeath
0
300
Optional Chainingについて
texdeath
3
200
副業として個人事業主をやる場合の メリット・デメリット
texdeath
0
120
Container Componentは必要なのか
texdeath
4
670
Kotlin/JSでReactアプリを作ってみた
texdeath
1
950
Other Decks in Programming
See All in Programming
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
3
2.6k
Claude Codeログ基盤の構築
giginet
PRO
7
3.8k
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
130
Migration to Signals, Signal Forms, Resource API, and NgRx Signal Store @Angular Days 03/2026 Munich
manfredsteyer
PRO
0
200
「速くなった気がする」をデータで疑う
senleaf24
0
110
AI活用のコスパを最大化する方法
ochtum
0
360
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
260
Codex の「自走力」を高める
yorifuji
0
1.3k
へんな働き方
yusukebe
6
2.9k
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
110
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
1.2k
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
820
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
240
Statistics for Hackers
jakevdp
799
230k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
190
Music & Morning Musume
bryan
47
7.1k
We Are The Robots
honzajavorek
0
210
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
Agile that works and the tools we love
rasmusluckow
331
21k
Believing is Seeing
oripsolob
1
100
4 Signs Your Business is Dying
shpigford
187
22k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
780
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