Skip to solution
hardFrontend

How do generic <script setup> components work (generic="T")?

885 views
01

Understand the problem

Explain typed generic props/emits with the generic attribute.

genericstypescriptscript-setup
02

Attempt it yourself

Sketch your approach before reading the solution — that's what interviews test.

Nudge consolestandby

Stuck? Beam a request up — the console returns a conceptual nudge that guides your logic without spoiling the implementation.

03

Study the solution

Add generic="T extends ..." to <div class="iq-diagram"><svg viewBox="0 0 820 180" xmlns="http://www.w3.org/2000/svg"><defs><marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto"><path d="M 0

Solution ready — 2 min read

Classified // press E to declassify

04

Join the discussion

Discussion (0)

Sign in to join the discussion.

No responses yet. Be the first to share what you think.

Transmission complete // awaiting log

KEEP THE
STREAK ALIVE.

Dossier 55 of 70 decoded in the Vue.js track. One more won't hurt.

Back to track