UNPKG

@antmjs/vantui

Version:

一套适用于Taro3及React的vantui组件库

38 lines 1.04 kB
import _slicedToArray from "@babel/runtime/helpers/slicedToArray"; /* eslint-disable */ import react from 'react'; import { DropdownMenu, DropdownItem } from '@antmjs/vantui'; import { jsx as _jsx } from "react/jsx-runtime"; import { jsxs as _jsxs } from "react/jsx-runtime"; export default function Demo() { var _react$useState = react.useState({ option1: [{ text: '全部商品', value: 0 }, { text: '新款商品', value: 1 }], option2: [{ text: '默认排序', value: 'a' }, { text: '好评排序', value: 'b' }], value1: 0, value2: 'a' }), _react$useState2 = _slicedToArray(_react$useState, 1), state = _react$useState2[0]; return /*#__PURE__*/_jsxs(DropdownMenu, { direction: "up", children: [/*#__PURE__*/_jsx(DropdownItem, { value: state.value1, options: state.option1 }), /*#__PURE__*/_jsx(DropdownItem, { value: state.value2, options: state.option2 })] }); }