vhoc
v0.0.0-alpha.4
Published
Create higher order vue3 components.
Downloads
181
Readme
Documentation: https://penjj.github.io/vhoc/
Playground: https://stackblitz.com/edit/vitejs-vite-jqkxzj?file=src/App.vue
Install
pnpm i vhoc -S
Usage
import { withProps } from 'vhoc'
const MyInput = withProps(Input)({
placeholder: 'Please enter.'
})
<MyInput /> // <Input placeholder="Please enter." />
<MyInput placeholder="Hello world." /> // <Input placeholder="Hello world." />
With unplugin-auto-import
// vite.config.js
import { VhocImports } from "vhoc/imports";
export default defineConfig({
plugins: [
AutoImport({
imports: [VhocImports()],
}),
],
});