refactor: use radix-vue Slot component

This commit is contained in:
sadeghbarati 2023-09-26 10:37:34 +03:30
parent 5ee0a4641e
commit 72382e986f
4 changed files with 6 additions and 17 deletions

View File

@ -42,7 +42,7 @@
"@vue/compiler-dom": "^3.3.4",
"autoprefixer": "^10.4.16",
"lodash.template": "^4.5.0",
"radix-vue": "^0.3.0",
"radix-vue": "^0.3.1",
"rimraf": "^5.0.1",
"tailwind-merge": "^1.14.0",
"tailwindcss": "^3.3.3",

View File

@ -1,5 +1,5 @@
<script lang="ts" setup>
import Slot from './Slot.vue'
import { Slot } from 'radix-vue'
import { useFormField } from './FormItem.vue'
const { error, formItemId, formDescriptionId, formMessageId } = useFormField()

View File

@ -1,11 +0,0 @@
<script setup lang="ts"></script>
<template>
<component
:is="
// @ts-ignore we can ignore this as we have validated the existence of 1 child in Primitive.vue
$slots.default?.()[0].children?.[0]
"
v-bind="$attrs"
/>
</template>

View File

@ -136,8 +136,8 @@ importers:
specifier: ^4.5.0
version: 4.5.0
radix-vue:
specifier: ^0.3.0
version: 0.3.0(vue@3.3.4)
specifier: ^0.3.1
version: 0.3.1(vue@3.3.4)
rimraf:
specifier: ^5.0.1
version: 5.0.1
@ -6846,8 +6846,8 @@ packages:
- vue
dev: false
/radix-vue@0.3.0(vue@3.3.4):
resolution: {integrity: sha512-maywNzZKUfp6Jhis01s2dXXArft3VZrAFylsqEkjEnznCTlt5+yd1g40XPH0EefAkgR1A6XTEA0l+FXFxNKk0w==}
/radix-vue@0.3.1(vue@3.3.4):
resolution: {integrity: sha512-izekMIzZq00rUJgJkTc5zGUREI4qzOavFHrJGb9g5eRiCO2njp8wsWXUpPGh6Z7f4UnAFLc5Z4QZTBIl5sx4TA==}
dependencies:
'@floating-ui/dom': 1.5.3
'@floating-ui/vue': 1.0.2(vue@3.3.4)