UNPKG

@antmjs/vantui

Version:

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

59 lines 3.02 kB
import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; import _createClass from "@babel/runtime/helpers/createClass"; import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized"; import _inherits from "@babel/runtime/helpers/inherits"; import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn"; import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf"; import _defineProperty from "@babel/runtime/helpers/defineProperty"; function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable */ import { Tab, Tabs } from '@antmjs/vantui'; import { Component } from 'react'; import DemoPage from '../../../../vantui-demo/src/components/demo-page/index'; import Demo1 from './demo1'; import Demo2 from './demo2'; import Demo3 from './demo3'; import { jsx as _jsx } from "react/jsx-runtime"; import { jsxs as _jsxs } from "react/jsx-runtime"; var Index = /*#__PURE__*/function (_Component) { _inherits(Index, _Component); var _super = _createSuper(Index); function Index(props) { var _this; _classCallCheck(this, Index); _this = _super.call(this, props); _defineProperty(_assertThisInitialized(_this), "state", { active: 0 }); return _this; } _createClass(Index, [{ key: "render", value: function render() { var _this2 = this; return /*#__PURE__*/_jsxs(DemoPage, { title: "InfiniteScroll \u65E0\u9650\u6EDA\u52A8", className: "pages-infinite-scroll-index", children: [/*#__PURE__*/_jsxs(Tabs, { active: this.state.active, onChange: function onChange(e) { return _this2.setState({ active: e.detail.index }); }, sticky: true, children: [/*#__PURE__*/_jsx(Tab, { title: "\u57FA\u672C\u4F7F\u7528" }), /*#__PURE__*/_jsx(Tab, { title: "\u865A\u62DF\u5217\u8868" }), /*#__PURE__*/_jsx(Tab, { title: "\u8BF7\u6C42\u5F02\u5E38" })] }), this.state.active === 0 ? /*#__PURE__*/_jsx(Demo1, {}) : '', this.state.active === 1 ? /*#__PURE__*/_jsx(Demo2, {}) : '', this.state.active === 2 ? /*#__PURE__*/_jsx(Demo3, {}) : ''] }); } }]); return Index; }(Component); export { Index as default };