UNPKG

@gizwits/vantui

Version:

机智云组件库

38 lines 2.31 kB
import _defineProperty from "@babel/runtime/helpers/defineProperty"; import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; var _excluded = ["wrapperStyle", "active", "anchorStyle", "index", "children", "style", "className"]; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } import { Text, View } from '@tarojs/components'; import React from 'react'; import * as utils from '../wxs/utils'; import { Fragment as _Fragment } from "react/jsx-runtime"; import { jsx as _jsx } from "react/jsx-runtime"; export function IndexAnchor(props) { var wrapperStyle = props.wrapperStyle, active = props.active, anchorStyle = props.anchorStyle, index = props.index, children = props.children, style = props.style, className = props.className, others = _objectWithoutProperties(props, _excluded); return /*#__PURE__*/_jsx(View, _objectSpread(_objectSpread({ className: "van-index-anchor-wrapper ".concat(className || ''), style: utils.style([wrapperStyle, style]) }, others), {}, { children: /*#__PURE__*/_jsx(View, { className: 'van-index-anchor ' + (active ? 'van-index-anchor--active van-hairline--bottom' : ''), style: anchorStyle, children: children ? /*#__PURE__*/_jsx(_Fragment, { children: children }) : /*#__PURE__*/_jsx(_Fragment, { children: /*#__PURE__*/_jsx(Text, { children: index }) }) }) })); } IndexAnchor.displayName = 'IndexAnchor'; export default IndexAnchor;