1. vue-component-type-helpers
Some very simple type helpers used behind `vue-component-meta` for extract component props, slots, emit, exposed types.
vue-component-type-helpers
Package: vue-component-type-helpers
Created by: vuejs
Last modified: Wed, 01 May 2024 03:38:37 GMT
Version: 2.0.16
License: MIT
Downloads: 3,741,126
Repository: https://github.com/vuejs/language-tools

Install

npm install vue-component-type-helpers
yarn add vue-component-type-helpers

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; }

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin