| difficulty | 1 |
|---|---|
| training | true |
| chapter | Chapter 6: TypeScript |
| tags | vue |
In this challenge, let's update the vTabs component created earlier on in the training to be type safe.
Use TypeScript to type the data injected via vTabs for use within vTabPanel.
- On line 26 of
vTabs.vueproperly type the injectionKey as anInjectionKeythat provides an object with the following properties:registerTab- a function that takes a title argument that's a string and returns voidactiveTab- a readonly reactive ref that is a a string or undefinedactivateTab- a function that takes a title argument that's a string and returns void
- Once the types are in place, all TS errors in
vTabPanel.vueshould disappear

