import{o as a,a as n,y as t}from"./vue-libs.b44bc779.js";const e={class:"van-doc-markdown-body"},l=t(`

useCustomFieldValue

Intro

Used to custom Field value.

Usage

Basic Usage

If you want to custom Form items, you can insert your component into the input slot of the Field component, and call the useCustomFieldValue method inside your custom component.

MyComponent

// MyComponent.vue
import { ref } from 'vue';
import { useCustomFieldValue } from '@vant/use';

export default {
  setup() {
    const myValue = ref(0);

    useCustomFieldValue(() => myValue.value);

    return { myValue };
  },
};

Form

<van-form>
  <van-field name="my-field" label="Custom Field">
    <template #input>
      <my-component />
    </template>
  </van-field>
</van-form>

API

Type Declarations

function useCustomFieldValue(customValue: () => unknown): void;

Params

NameDescriptionTypeDefault Value
customValueFunction to get field value() => unknown-
`,7),p=[l],r={__name:"use-custom-field-value.en-US",setup(o,{expose:s}){return s({frontmatter:{}}),(d,i)=>(a(),n("div",e,p))}};export{r as default};