UNPKG

@antmjs/vantui

Version:

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

38 lines 1.29 kB
import _slicedToArray from "@babel/runtime/helpers/slicedToArray"; /* eslint-disable */ import react from 'react'; import { Tabbar, TabbarItem, Image } 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('home'), _react$useState2 = _slicedToArray(_react$useState, 2), active = _react$useState2[0], setActive = _react$useState2[1]; return /*#__PURE__*/_jsxs(Tabbar, { active: active, onChange: function onChange(e) { return setActive(e.detail); }, children: [/*#__PURE__*/_jsx(TabbarItem, { info: "3", renderIcon: /*#__PURE__*/_jsx(Image, { src: "https://img.yzcdn.cn/vant/user-inactive.png", fit: "fill", style: "width: 30px; height: 18px;" }), renderIconActive: /*#__PURE__*/_jsx(Image, { src: "https://img.yzcdn.cn/vant/user-active.png", fit: "fill", style: "width: 30px; height: 18px;" }), children: "\u81EA\u5B9A\u4E49" }), /*#__PURE__*/_jsx(TabbarItem, { icon: "search", children: "\u6807\u7B7E" }), /*#__PURE__*/_jsx(TabbarItem, { icon: "setting-o", children: "\u6807\u7B7E" })] }); }