Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | 1x 1x 1x | import React, { useState } from "react"; import { Select, SelectMultiple } from "@tencent/tea-component/lib/select"; import { Form } from "@tencent/tea-component/lib/form"; const options = [ { value: "strawberry", text: "草莓", tooltip: "甜甜甜" }, { value: "apple", text: "苹果", tooltip: "每日一苹果,医生远离我" }, { value: "orange", text: "橙子", tooltip: "丰富 VC 含量" }, { value: "durian", text: "榴莲", disabled: true, tooltip: "榴莲已售罄" }, { value: "coca-cola", text: "可口可乐" }, { value: "pepsi-cola", text: "百事可乐" }, ]; export default function SelectExample() { const [favorite, setFavorite] = useState(null); return ( <Form> <Form.Item label="单选"> <Select searchable boxSizeSync size="m" type="simulate" appearance="button" options={options} value={favorite} onChange={value => setFavorite(value)} /> </Form.Item> <Form.Item label="多选"> <SelectMultiple staging={false} searchable size="m" appearance="button" options={options} /> </Form.Item> </Form> ); } |