mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 07:38:13 +00:00
fix: external data source filterTargetKey undefined in filter action (#4815)
* fix: external data source filterTargetKey undefined in filter action * fix: bug
This commit is contained in:
parent
cfcf9291dc
commit
a754bcedd8
@ -8,15 +8,20 @@
|
||||
*/
|
||||
|
||||
import { ExclamationCircleTwoTone } from '@ant-design/icons';
|
||||
import { useCollectionRecordData, useCompile } from '@nocobase/client';
|
||||
import { useCollectionRecordData, useCompile, Input } from '@nocobase/client';
|
||||
import { useField } from '@formily/react';
|
||||
import { Popover } from 'antd';
|
||||
import React from 'react';
|
||||
import { SetFilterTargetKey } from './SetFilterTargetKey';
|
||||
|
||||
export const CollectionTitle = () => {
|
||||
const record = useCollectionRecordData();
|
||||
export const CollectionTitle = (props) => {
|
||||
const record = useCollectionRecordData() || {};
|
||||
const compile = useCompile();
|
||||
if (record.filterTargetKey) {
|
||||
const field = useField();
|
||||
if (field.editable) {
|
||||
return <Input {...props} />;
|
||||
}
|
||||
if (record?.filterTargetKey) {
|
||||
return compile(record.title);
|
||||
}
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user