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
390
クライアントワークと管理画面の話
texdeath
0
300
次世代ヘッドレス開発室が提供するヘッドレスEC
texdeath
0
670
中期プロジェクトで e2eテストを導入してみて感じたこと
texdeath
2
7.9k
React使いがVueと仲良くなるためにやったこと
texdeath
0
310
Optional Chainingについて
texdeath
3
210
副業として個人事業主をやる場合の メリット・デメリット
texdeath
0
120
Container Componentは必要なのか
texdeath
4
670
Kotlin/JSでReactアプリを作ってみた
texdeath
1
960
Other Decks in Programming
See All in Programming
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
2
440
TSKaigi2026-静的解析への投資がAI時代のコード品質を支える ── カスタムESLintルールの設計と運用
hayatokudou
6
1.3k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
210
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
12
3.2k
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
120
New "Type" system on PicoRuby
pocke
1
330
誰も頼んでない機能を出荷した話
zekutax
0
150
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
11
3k
新規プロダクトを高速で生み出すハーネスエンジニアリング
seanchas116
15
7.3k
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
380
Inspired By RubyKaigi (EN)
atzzcokek
0
400
iOS26時代の新規アプリ開発
yuukiw00w
0
210
Featured
See All Featured
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
120
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
210
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
350
Utilizing Notion as your number one productivity tool
mfonobong
4
310
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
RailsConf 2023
tenderlove
30
1.4k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
140
エンジニアに許された特別な時間の終わり
watany
107
240k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
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