CollectionFilterPanel

CollectionFilterPanel dùng để nhúng panel lọc Collection vào trang.

Cách dùng cơ bản

import { CollectionFilterPanel, type CollectionFilterPanelRef } from '@nocobase/client-v2';

const ref = useRef<CollectionFilterPanelRef>(null);

<CollectionFilterPanel ref={ref} collection={collection} t={t} />;

const filter = ref.current?.getFilter();

API

Tham sốKiểuMô tả
collection`Collectionundefined`
initialValueRecord<string, unknown>Giá trị filter ban đầu
onChange(filter) => voidCallback khi thay đổi
t(key, options?) => stringHàm dịch
filterableFieldNamesstring[]Danh sách field được phép
nonfilterableFieldNamesstring[]Danh sách field bị chặn
noIgnorebooleanBỏ qua giới hạn danh sách cho phép

Phương thức

Phương thứcMô tả
getFilter()Get the compiled filter
reset()Clear all conditions

Liên kết liên quan