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
0
480
おさらいVue Composition API
Vue3.xのRFCに導入されるVue Composition APIの紹介です。
texdeath
November 21, 2019
Tweet
Share
More Decks by texdeath
See All by texdeath
コードメトリクス計測による課題可視化と品質確保 / Visualize issues and ensure quality by measuring code metrics
texdeath
0
360
クライアントワークと管理画面の話
texdeath
0
270
次世代ヘッドレス開発室が提供するヘッドレス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
940
Other Decks in Programming
See All in Programming
AI活用のコスパを最大化する方法
ochtum
0
120
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
270
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.4k
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
12
7.4k
Rubyと楽しいをつくる / Creating joy with Ruby
chobishiba
0
200
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
170
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
240
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
200
15年目のiOSアプリを1から作り直す技術
teakun
1
590
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
220
Premier Disciplin for Micro Frontends Multi Version/ Framework Scenarios @OOP 2026, Munic
manfredsteyer
PRO
0
200
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Mind Mapping
helmedeiros
PRO
1
110
Visualization
eitanlees
150
17k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The Invisible Side of Design
smashingmag
302
51k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
400
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
63
The untapped power of vector embeddings
frankvandijk
2
1.6k
Faster Mobile Websites
deanohume
310
31k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
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