pnpm install @maas/vue-primitive
<template>
<Primitive as="button" type="button" @click="handleClick">
Click me
</Primitive>
</template>
<button type="button">Click me</button>
<template>
<Primitive
as-child
type="button"
class="my-button"
@click="handleClick"
>
<button>Click me</button>
</Primitive>
</template>
<button type="button" class="my-button">Click me</button>
If you see something that doesn’t look right, submit a bug report. See it. Say it. Sorted.
This package is mostly a port of Radix Vue’s Primitive
component. The original concept of the asChild
prop was invented by the creators of Radix Primitives as far as we know.
MIT License © 2024-PRESENT Magic as a Service GmbH