vue-component-type-helpers
TypeScript icon, indicating that this package has built-in type declarations

2.0.19 • Public • Published

vue-component-type-helpers

Some very simple type helpers used behind vue-component-meta for extract component props, slots, emit, exposed types.

Usage

<template>
	<slot name="header" :num="123" />
	<slot name="footer" str="abc" />
</template>

<script lang="ts" setup>
defineProps<{
	msg: string
}>()
</script>
import HelloWorld from './HelloWorld.vue'
import type { ComponentProps, ComponentSlots } from 'vue-component-type-helpers'

type Props = ComponentProps<typeof HelloWorld> // { msg: string }
type Slots = ComponentSlots<typeof HelloWorld> // { header(_: { num: number; }): any; footer(_: { str: string; }): any; }

Readme

Keywords

none

Package Sidebar

Install

npm i vue-component-type-helpers

Weekly Downloads

938,090

Version

2.0.19

License

MIT

Unpacked Size

4.73 kB

Total Files

7

Last publish

Collaborators

  • johnsoncodehk