vite-plugin-vue-component-props
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

vite-plugin-vue-component-props

NPM version

Features

  • [x] Make the vue script syntax support the props type imports from other files

Install

node version: >=12.0.0 vite version: >=2.0.0

pnpm i vite-plugin-vue-component-props -D

or

npm i vite-plugin-vue-component-props -D

or

yarn add vite-plugin-vue-component-props -D

Usage

  • Config plugin in vite.config.ts. In this way, the required functions can be introduced as needed
import { Plugin, defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueComponentProps from 'vite-plugin-vue-component-props'

export default defineConfig({
  plugins: [vue(), vueComponentProps()],
})
  • SFC
export interface Props {
  world: string
}
<script lang="ts" setup name="App">
import type { Props } from './Props'

defineProps<Props>()
</script>

<template>
  <div>hello {{ world }}</div>
</template>

License

MIT License © 2023 tttxdxd

Package Sidebar

Install

npm i vite-plugin-vue-component-props

Weekly Downloads

3

Version

0.0.5

License

MIT

Unpacked Size

14.2 kB

Total Files

6

Last publish

Collaborators

  • tttxdxd