mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 12:38:53 +08:00
Merge pull request #1547 from 2betop/filterable
非 loadDataOnce 模式 filterable: true 也可以自动从当前数据中提取选项
This commit is contained in:
commit
8f469b34bd
@ -342,7 +342,7 @@ export default class App extends React.Component<AppProps, object> {
|
||||
}}
|
||||
isActive={(link: any) => !!env.isCurrentUrl(link?.path, link)}
|
||||
/>
|
||||
{asideBefore ? render('aside-before', asideBefore) : null}
|
||||
{asideAfter ? render('aside-before', asideAfter) : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ export class HeadCellFilterDropDown extends React.Component<
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const {filterable} = this.props;
|
||||
const {filterable, name, store} = this.props;
|
||||
|
||||
if (filterable.source) {
|
||||
this.fetchOptions();
|
||||
@ -80,9 +80,10 @@ export class HeadCellFilterDropDown extends React.Component<
|
||||
} else if (
|
||||
name &&
|
||||
!this.state.filterOptions.length &&
|
||||
Array.isArray(props.store?.data.itemsRaw)
|
||||
(Array.isArray(props.store?.data.itemsRaw) ||
|
||||
Array.isArray(props.store?.data.items))
|
||||
) {
|
||||
const itemsRaw = props.store?.data.itemsRaw;
|
||||
const itemsRaw = props.store?.data.itemsRaw || props.store?.data.items;
|
||||
const values: Array<any> = [];
|
||||
itemsRaw.forEach((item: any) => {
|
||||
const value = getVariable(item, name);
|
||||
|
Loading…
Reference in New Issue
Block a user