UNPKG

@maas/vue-primitive

Version:

Vue component for passing attributes to slot content

50 lines (34 loc) β€’ 1.22 kB
# πŸ₯š Vue Primitive ## πŸ“¦ Install ``` pnpm install @maas/vue-primitive ``` ## πŸͺ„ Use ### as ```vue <template> <Primitive as="button" type="button" @click="handleClick"> Click me </Primitive> </template> ``` ```html <button type="button">Click me</button> ``` ### asChild ```vue <template> <Primitive as-child type="button" class="my-button" @click="handleClick"> <button>Click me</button> </Primitive> </template> ``` ```html <button type="button" class="my-button">Click me</button> ``` ## πŸ› Found a Bug? If you see something that doesn’t look right, [submit a bug report](https://github.com/magicasaservice/vue-primitive/issues/new?assignees=&labels=bug%2Cpending+triage&template=bug_report.yml). See it. Say it. Sorted. ## 🀝 Credit This package is mostly a port of [Radix Vue](https://github.com/unovue/reka-ui/tree/v1)’s `Primitive` component. The original concept of the `asChild` prop was invented by the creators of [Radix Primitives](https://github.com/radix-ui/primitives) as far as we know. ## πŸ“„ License [MIT License](https://github.com/magicasaservice/vue-primitive/blob/main/LICENSE) Β© 2024-PRESENT [Magic as a Service GmbH](https://github.com/magicasaservice)