UNPKG

antd-mobile-taro-ui

Version:

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

21 lines 801 B
import React from 'react'; import classNames from 'classnames'; import { View } from '@tarojs/components'; import { withNativeProps } from 'antd-mobile/es/utils/native-props'; import { mergeProps } from 'antd-mobile/es/utils/with-default-props'; const classPrefix = `adm-list`; const defaultProps = { mode: 'default' }; export const List = p => { const props = mergeProps(defaultProps, p); return withNativeProps(props, React.createElement(View, { className: classNames(classPrefix, `${classPrefix}-${props.mode}`) }, props.header && React.createElement(View, { className: `${classPrefix}-header` }, props.header), React.createElement(View, { className: `${classPrefix}-body` }, React.createElement(View, { className: `${classPrefix}-body-inner` }, props.children)))); };