UNPKG

@antmjs/vantui

Version:

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

38 lines 1.26 kB
import _slicedToArray from "@babel/runtime/helpers/slicedToArray"; /* eslint-disable */ import react from 'react'; import { View } from '@tarojs/components'; import { Cell, ShareSheet, Toast } from '@antmjs/vantui'; import { jsx as _jsx } from "react/jsx-runtime"; import { jsxs as _jsxs } from "react/jsx-runtime"; var options = [{ name: 'URL图标1', icon: 'https://img.yzcdn.cn/vant/custom-icon-fire.png' }, { name: 'URL图标2', icon: 'https://img.yzcdn.cn/vant/custom-icon-light.png' }]; export default function Demo() { var _react$useState = react.useState(false), _react$useState2 = _slicedToArray(_react$useState, 2), show = _react$useState2[0], setShow = _react$useState2[1]; return /*#__PURE__*/_jsxs(View, { children: [/*#__PURE__*/_jsx(Cell, { title: "\u663E\u793A\u5206\u4EAB\u9762\u677F", onClick: function onClick() { return setShow(true); } }), /*#__PURE__*/_jsx(ShareSheet, { show: show, title: "\u7ACB\u5373\u5206\u4EAB\u7ED9\u597D\u53CB", options: options, onSelect: function onSelect(e) { return Toast.show(e.detail.name); }, onClose: function onClose() { return setShow(false); } }), /*#__PURE__*/_jsx(Toast, {})] }); }