UNPKG

@antmjs/vantui

Version:

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

57 lines (55 loc) 2.3 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = Demo; var _react = _interopRequireDefault(require("react")); var _vantui = require("@antmjs/vantui"); var _components = require("@tarojs/components"); var _jsxRuntime = require("react/jsx-runtime"); /* eslint-disable */ function Demo() { var CountUpRef = _react.default.useRef(); var handleFinish = function handleFinish() { _vantui.Toast.show('count finish'); }; return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vantui.Toast, { id: "controlCountUp-mess" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_vantui.CountUp, { startVal: 30, endVal: 500, ref: CountUpRef, onFinish: handleFinish }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_vantui.Grid, { clickable: true, columnNum: 4, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vantui.GridItem, { text: "\u5F00\u59CB", onClick: function onClick() { var _CountUpRef$current; return (_CountUpRef$current = CountUpRef.current) === null || _CountUpRef$current === void 0 ? void 0 : _CountUpRef$current.start(); } }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_vantui.GridItem, { text: "\u6682\u505C", onClick: function onClick() { var _CountUpRef$current2; return (_CountUpRef$current2 = CountUpRef.current) === null || _CountUpRef$current2 === void 0 ? void 0 : _CountUpRef$current2.pause(); } }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_vantui.GridItem, { text: "\u7EE7\u7EED", onClick: function onClick() { var _CountUpRef$current3; return (_CountUpRef$current3 = CountUpRef.current) === null || _CountUpRef$current3 === void 0 ? void 0 : _CountUpRef$current3.resume(); } }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_vantui.GridItem, { text: "\u91CD\u7F6E", onClick: function onClick() { var _CountUpRef$current4; return (_CountUpRef$current4 = CountUpRef.current) === null || _CountUpRef$current4 === void 0 ? void 0 : _CountUpRef$current4.reset(); } })] })] }); }