UNPKG

antd-mobile-taro-ui

Version:

以antd-mobile为设计标准,基于taro框架的微信小程序组件库

18 lines 733 B
import React from 'react'; import classNames from 'classnames'; import { withNativeProps } from 'antd-mobile/es/utils/native-props'; import { mergeProps } from 'antd-mobile/es/utils/with-default-props'; import { View } from '@tarojs/components'; const classPrefix = `adm-divider`; const defaultProps = { contentPosition: 'center', direction: 'horizontal' }; export const Divider = p => { const props = mergeProps(defaultProps, p); return withNativeProps(props, React.createElement(View, { className: classNames(classPrefix, `${classPrefix}-${props.direction}`, `${classPrefix}-${props.contentPosition}`) }, props.children && React.createElement(View, { className: `${classPrefix}-content` }, props.children))); };