列表综合筛选
This commit is contained in:
@@ -1,34 +1,7 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import styles from "./index.module.scss";
|
||||
import BubbleItem from "./BubbleItem";
|
||||
|
||||
export interface BubbleOption {
|
||||
id: string | number;
|
||||
label: string;
|
||||
value: string | number;
|
||||
disabled?: boolean;
|
||||
icon?: React.ReactNode;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface BubbleProps {
|
||||
options: BubbleOption[];
|
||||
value?: string | number | (string | number)[];
|
||||
onChange?: (
|
||||
name: string,
|
||||
value: string | number | (string | number)[],
|
||||
option: BubbleOption | BubbleOption[]
|
||||
) => void;
|
||||
multiple?: boolean;
|
||||
layout?: "horizontal" | "vertical" | "grid";
|
||||
columns?: number;
|
||||
size?: "small" | "medium" | "large";
|
||||
className?: string;
|
||||
itemClassName?: string;
|
||||
style?: React.CSSProperties;
|
||||
disabled?: boolean;
|
||||
name: string;
|
||||
}
|
||||
import {BubbleProps} from '../../../types/list/types'
|
||||
|
||||
const Bubble: React.FC<BubbleProps> = ({
|
||||
options,
|
||||
@@ -79,6 +52,7 @@ const Bubble: React.FC<BubbleProps> = ({
|
||||
);
|
||||
onChange(name, newSelectedValues, selectedOptions);
|
||||
} else {
|
||||
console.log('===111', name, option.value)
|
||||
onChange(name, option.value, option);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user