fix: update `ApiComponent` to bind class and style attributes from attrs

pull/58/head
chenminjie 2024-12-12 17:15:35 +08:00
parent adea92b879
commit 811801b70c
1 changed files with 2 additions and 1 deletions

View File

@ -81,6 +81,7 @@ const emit = defineEmits<{
const modelValue = defineModel({ default: '' });
const attrs = useAttrs();
const { class: className, style }: Record<string, any> = attrs;
const refOptions = ref<OptionsItem[]>([]);
const loading = ref(false);
@ -188,7 +189,7 @@ function emitChange() {
}
</script>
<template>
<div v-bind="{ ...$attrs }">
<div v-bind="{ class: className, style }">
<component
:is="component"
v-bind="bindProps"