mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-19 22:41:42 +01:00
fix(module): retain props reactivity through useUI (#745)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, provide, inject, ref } from 'vue'
|
||||
import { computed, defineComponent, provide, inject, ref, toRef } from 'vue'
|
||||
import type { Ref, PropType } from 'vue'
|
||||
import { useUI } from '../../composables/useUI'
|
||||
import { mergeConfig } from '../../utils'
|
||||
@@ -70,13 +70,17 @@ export default defineComponent({
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
class: {
|
||||
type: [String, Object, Array] as PropType<any>,
|
||||
default: undefined
|
||||
},
|
||||
ui: {
|
||||
type: Object as PropType<Partial<typeof config & { strategy?: Strategy }>>,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
setup (props) {
|
||||
const { ui, attrs } = useUI('formGroup', props.ui, config, { mergeWrapper: true })
|
||||
const { ui, attrs } = useUI('formGroup', toRef(props, 'ui'), config, toRef(props, 'class'))
|
||||
|
||||
const formErrors = inject<Ref<FormError[]> | null>('form-errors', null)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user