Skip to main content

ViewPicker

View selector, using this components you can select all views of the currently datasheet.

Parameters

NameType
propsIViewPicker

Returns

Element

Example

Common usage.

import React, { useState } from 'react';
import { ViewPicker } from '@apitable/widget-sdk';
const Example = () => {
const [viewId, setViewId] = useState()
return <ViewPicker viewId={viewId} onChange={option => setViewId(option.value)} />
}

Use useCloudStorage implementing persistent storage.

import React from 'react';
import { ViewPicker, useCloudStorage } from '@apitable/widget-sdk';
const ExampleCloud = () => {
const [viewId, setViewId] = useCloudStorage('selectViewId');
return <ViewPicker viewId={viewId} onChange={option => setViewId(option.value)} />;
};