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
400
クライアントワークと管理画面の話
texdeath
0
300
次世代ヘッドレス開発室が提供するヘッドレス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
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
250
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
190
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
Lessons from Spec-Driven Development
simas
PRO
0
200
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.1k
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
130
dRuby over BLE
makicamel
2
340
エージェンティックRAGにAWSで入門しよう!
har1101
8
1.6k
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
180
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
6
1.3k
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
120
Featured
See All Featured
How to Ace a Technical Interview
jacobian
281
24k
Raft: Consensus for Rubyists
vanstee
141
7.5k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
590
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Mind Mapping
helmedeiros
PRO
1
250
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
240
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Between Models and Reality
mayunak
4
340
Ethics towards AI in product and experience design
skipperchong
2
310
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
340
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
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