/vue-simple-props

Remove emits, slots, and attrs concepts in Vue.

Primary LanguageTypeScriptMIT LicenseMIT

vue-simple-props npm

Unit Test

Remove emits, slots, and attrs concepts in Vue.

Features

  • 🤐 No need to define props, emits, slots, and attrs in runtime.
  • 🦾 Fully TypeScript support.
  • 👾 Non-invasive.

Install

npm i vue-simple-props

Usage

import { defineSimpleComponent, useProps } from 'vue-simple-props'

interface Props {
  foo: string
  onClick: () => void
  renderDefault?: () => JSX.Element
}

export const Comp = defineSimpleComponent<Props>({
  name: 'Comp',
  setup() {
    const props = useProps<Props>()
    return () => <div>...</div>
  },
})

Sponsors

License

MIT License © 2023 三咲智子