✨ feat(购物界面): 完成购物界面50%

This commit is contained in:
xuan
2022-09-15 19:59:19 +08:00
parent 8472f4c14b
commit fee33aec38
124 changed files with 1939 additions and 28 deletions
+4 -3
View File
@@ -8,7 +8,7 @@
*/
import { View } from '@tarojs/components'
import { FC, ReactNode } from 'react'
import React, { FC, ReactNode } from 'react'
import styles from './index.module.scss'
import classnames from 'classnames'
@@ -20,9 +20,10 @@ interface DividerProps {
contentPosition?: 'left' | 'center' | 'right'
children?: ReactNode
customClassName?: string
customStyles?: React.CSSProperties
}
const Divider: FC<DividerProps> = (props) => {
const { direction = 'horizontal', borderStyle = 'solid', contentPosition = 'center', customClassName='' } = props
const { direction = 'horizontal', borderStyle = 'solid', contentPosition = 'center', customClassName = '', customStyles = {} } = props
const classname = classnames(styles['divider'], styles['divider-' + direction], customClassName)
const contentClassname = classnames(styles['divider-text'], styles['is-' + contentPosition])
@@ -37,7 +38,7 @@ const Divider: FC<DividerProps> = (props) => {
const dividerStyle = direction === 'horizontal' ? borderTopStyle : borderLeftStyle
return (
<View className={classname} style={dividerStyle}>
<View className={classname} style={{ ...dividerStyle, ...customStyles }}>
{props.children && direction !== 'vertical' && <View className={contentClassname}>{props.children}</View>}
</View>
)