RemoteSelect

RemoteSelect is used to load Select options asynchronously from an API.

Basic Usage

import { RemoteSelect } from '@nocobase/client-v2';

<RemoteSelect<{ name: string; title: string }>
  request={async () => {
    const { data } = await ctx.api.resource('providers').list();
    return data.data;
  }}
  fieldNames={{ label: 'title', value: 'name' }}
/>;

API

PropTypeDescription
request() => Promise<T[]>Async request for loading options
fieldNames{ label; value }Map option label and value fields
optionsDefaultOptionType[]Static options
modeSelectProps['mode']Select mode
showSearchbooleanWhether search is enabled
filterOption`booleanfunction`