vue-component-type-helpers 1.3.14-patch.1 → 1.3.14-patch.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# vue-component-type-helpers
|
|
2
|
+
|
|
3
|
+
Some very simple type helpers used behind `vue-component-meta` for extract component props, slots, emit, exposed types.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```vue
|
|
8
|
+
<template>
|
|
9
|
+
<slot name="header" :num="123" />
|
|
10
|
+
<slot name="footer" str="abc" />
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts" setup>
|
|
14
|
+
defineProps<{
|
|
15
|
+
msg: string
|
|
16
|
+
}>()
|
|
17
|
+
</script>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import HelloWorld from './HelloWorld.vue'
|
|
22
|
+
import { ComponentProps, ComponentSlots } from 'vue-component-type-helpers'
|
|
23
|
+
|
|
24
|
+
type Props = ComponentProps<typeof HelloWorld> // { msg: string }
|
|
25
|
+
type Slots = ComponentSlots<typeof HelloWorld> // { header(_: { num: number; }): any; footer(_: { str: string; }): any; }
|
|
26
|
+
```
|