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
8k
React使いがVueと仲良くなるためにやったこと
texdeath
0
320
Optional Chainingについて
texdeath
3
240
副業として個人事業主をやる場合の メリット・デメリット
texdeath
0
130
Container Componentは必要なのか
texdeath
4
710
Kotlin/JSでReactアプリを作ってみた
texdeath
1
980
Other Decks in Programming
See All in Programming
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
180
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
1
320
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
200
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
860
GraphQL の onError と Nullability のこれから
quramy
0
220
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
まずはコードより業務と向き合う:テーブル解体のためにPdMを呼んだ話
sakawe_ee
0
230
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
170
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
260
SODA - FACT BOOK(EN)
sodainc
1
240
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
2
360
Crash Auto Pipelines
veronikapj
1
410
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1033
470k
Ethics towards AI in product and experience design
skipperchong
2
460
Building Adaptive Systems
keathley
44
3.3k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
60k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Utilizing Notion as your number one productivity tool
mfonobong
4
640
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
620
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
520
First, design no harm
axbom
PRO
2
1.4k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.4k