1
0
mirror of https://github.com/robonen/tools.git synced 2026-03-20 10:54:44 +00:00

feat(monorepo): migrate vue packages and apply oxlint refactors

This commit is contained in:
2026-03-07 18:07:22 +07:00
parent abd6605db3
commit 41d5e18f6b
286 changed files with 10295 additions and 5028 deletions

View File

@@ -0,0 +1,22 @@
import type { Component, IntrinsicElementAttributes, SetupContext } from 'vue';
import { h } from 'vue';
import { Slot } from './Slot';
type FunctionalComponentContext = Omit<SetupContext, 'expose'>;
export interface PrimitiveProps {
as?: keyof IntrinsicElementAttributes | Component;
}
export function Primitive(props: PrimitiveProps, ctx: FunctionalComponentContext) {
return props.as === 'template'
? h(Slot, ctx.attrs, ctx.slots)
: h(props.as!, ctx.attrs, ctx.slots);
}
Primitive.props = {
as: {
type: [String, Object],
default: 'div' as const,
},
};