import './demo1.css'; import React from 'react'; import ReactDOM from 'react-dom'; import Search from '..'; import { ConfigProvider, Menu, Radio } from '../..'; function onSearch(v) { console.log(v); } const dataSource = [ { label: 'Recent label', value: 'Recent', }, { label: 'dress label', value: 'dress', }, { label: 'sunglasses label', value: 'sunglasses', }, { label: 't-shirt label', value: 't-shirt', }, ]; const sizeList = [{ value: 'large', label: 'large', }, { value: 'medium', label: 'medium', }, { value: 'small', label: 'small', }, { value: 'xs', label: 'xs', }]; const typeList = [{ value: 'normal', label: 'normal', }, { value: 'brand', label: 'brand', }, { value: 'dark', label: 'dark', }]; const disabledList = [{ value: true, label: 'true', }, { value: false, label: 'false', }]; const themeList = [{ value: 'white', label: 'white', }, { value: 'grey', label: 'grey', }]; const menuData = [ { label: 'Products', value: 'Products', }, { label: 'Products1', value: 'Products1', }, { label: 'Products2', value: 'Products2', }, { label: 'Products3', value: 'Products3', }, { label: 'Products4', value: 'Products4', }, { label: 'Products5', value: 'Products5', }, { label: 'Products6', value: 'Products6', }, { label: 'Products7', value: 'Products7', }, { label: 'Products8', value: 'Products8', }, { label: 'Products9', value: 'Products9', }, { label: 'Products10', value: 'Products10', }, { label: 'Suppliers1111111111', value: 'Suppliers1111111111', }, ]; interface IState { size: 'large' | 'medium' | 'small' | 'xs'; value: string, disabled: boolean, theme: 'white' | 'grey', type: 'normal' | 'brand' | 'dark', menuData: { label: string; value: string; }[]; } class App extends React.Component<{}, IState> { constructor(props) { super(props); this.state = { size: 'large', menuData, value: '', disabled: false, theme: 'white', type: 'normal', }; } handleSize = size => { this.setState({ size }); }; handleDisabled = disabled => { this.setState({ disabled }); }; handleTheme = theme => { this.setState({ theme }); }; handleType = type => { this.setState({ type }); }; onSearch = (value, filterValue) => { console.log(value, filterValue); }; onChange = value => { this.setState({ value, }); }; // value is filter value,obj is the search value onFilterChange(value) { console.log(value); } renderMenu() { const menuData = this.state.menuData; return (
); } render() { const { size, disabled, theme, type } = this.state; return (default
custom text
custom text widthout icon
Suppliers
Suppliers and relevance