~/talk

Unlocking Reusability Generically Typed Vue.js Components

Talkat Vue.js Nation 2024 · 2024-01-24..01-25· [typescript, frontend-architecture]
slides:none on file

Shows how to add TypeScript generics to Vue 3 components using the new generic attribute, composition API patterns, conditional types and the DefineModel macro. Builds typed Input and Select components that keep v-model types consistent between number and string modes, enable slot-prop autocompletion without mapping, and surface mismatches as compile-time errors suitable for CI. Demonstrates a generic context-menu pattern, explains constraints and trade-offs, and shows the approach works end-to-end with runtime behavior unchanged.

AI-written summary · about

  1. 0:00Generics in TypeScript
  2. 6:07Generic Vue.js components
  3. 8:36Input type conflicts
  4. 13:58Reusable select components
  5. 24:33Advanced patterns
  6. 27:04Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.