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
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
420
クライアントワークと管理画面の話
texdeath
0
310
次世代ヘッドレス開発室が提供するヘッドレスEC
texdeath
0
680
中期プロジェクトで e2eテストを導入してみて感じたこと
texdeath
2
8k
React使いがVueと仲良くなるためにやったこと
texdeath
0
310
Optional Chainingについて
texdeath
3
210
副業として個人事業主をやる場合の メリット・デメリット
texdeath
0
130
Container Componentは必要なのか
texdeath
4
680
Kotlin/JSでReactアプリを作ってみた
texdeath
1
960
Other Decks in Programming
See All in Programming
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
8
3.7k
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
100
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
0
180
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
240
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
300
エージェンティックRAGにAWSで入門しよう!
har1101
9
1.9k
えっ!!コードを読まずに開発を!?
hananouchi
0
170
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
480
ローカルLLMでどこまでコードが書けるか -縮小版 / How much code can be written on a local LLM Shortened
kishida
2
180
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.8k
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.4k
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.8k
Featured
See All Featured
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
220
Balancing Empowerment & Direction
lara
6
1.2k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
[SF Ruby Conf 2025] Rails X
palkan
2
1.1k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
460
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
500
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Bash Introduction
62gerente
615
220k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
410
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