user13267766
user13267766

Reputation: 21

How to reach the child components prop when using in FormKit?

I have a component like this

import {defineComponent, reactive, computed} from "vue";
import {FormKit} from "@formkit/vue";

export default defineComponent({
    name: 'component',
    components: {FormKit,},
    props: {
        context: {
            type: Object,
            required: true,
        },
    },

    setup(props ) {
         const value = computed(() =>  props.context._value !== undefined ? Number(props.context._value) : 0);

        const foo = (number) => {
            props.context.node.input(number);
        };

        return {
            foo,
            value
        };
    },
});

and I am using it as a custom input in FormKit:

<FormKit
  type="component"
  :label="test"
  :help="" 
  >

In help text of FormKit, I want to show the components props.context._value or value under component. How can I access that from FormKit?

Upvotes: 0

Views: 21

Answers (0)

Related Questions