index.md
763 Bytes
nav: path: /component title: 组件 order: 1 group: path: /sort title: 排序
order: 0
排序规则
import React, { useState } from 'react';
import { QxSortCondition } from './index';
import {options1} from './mock';
export default () => {
const [values, setValues] = useState<
{
key: string;
asc: boolean;
}[]
>([
{
key: 'created_at',
asc: false,
},
]);
const props = {
onChange: (
_val: {
key: string;
asc: boolean;
}[],
) => {
setValues(_val);
},
value: values,
optionList: options1,
};
return <div style={{
width: 400,
}}>
<QxSortCondition {...props} />
</div>;
};
// <API id="QxSortCondition"></API>