Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
おさらいVue Composition API
Search
texdeath
November 21, 2019
Programming
510
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
Transcript
13 slides
͓͞Β͍ 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
More Decks by texdeath
See All by texdeath
コードメトリクス計測による課題可視化と品質確保 / Visualize issues and ensure quality by measuring code metrics
texdeath
0
450
クライアントワークと管理画面の話
texdeath
0
350
次世代ヘッドレス開発室が提供するヘッドレスEC
texdeath
0
690
中期プロジェクトで e2eテストを導入してみて感じたこと
texdeath
2
8.1k
React使いがVueと仲良くなるためにやったこと
texdeath
0
320
Optional Chainingについて
texdeath
3
240
副業として個人事業主をやる場合の メリット・デメリット
texdeath
0
140
Container Componentは必要なのか
texdeath
4
710
Kotlin/JSでReactアプリを作ってみた
texdeath
1
980
Other Decks in Programming
See All in Programming
AI駆動開発4年目の現在地(『あなたはFDEになるべきか?』イベント資料)
kumaiu
0
700
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
120
imagewebp()の向こう側: WebPはなぜ JPEG・PNGより軽いのか
yuzneri
0
150
Agentic AI with the Power of Jakarta EE
ivargrimstad
0
190
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
230
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
17
9.5k
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
440
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
390
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
800
Kotlin JVM用に作られたライブラリのKMPを前提とした再設計
jsoizo
0
230
止まらない比較を止める — 余帰納法で無限ストリームを比べる
tarao
0
210
テストだけで見つかる? Rubyでつくるメソッド発掘器
izawa
0
160
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.2k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
73
43k
For a Future-Friendly Web
brad_frost
184
11k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.9k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
[SF Ruby Conf 2025] Rails X
palkan
3
1.6k
Claude Code のすすめ
schroneko
67
230k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
370
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
390
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k