UNPKG

xcandy

Version:
29 lines 911 B
import { Component } from "@tarojs/taro-h5"; import Nerv from "nervjs"; import { View } from '@tarojs/components'; import './index.scss'; class XcListItem extends Component { constructor() { super(...arguments); } render() { const { arrow } = this.props; const arrowStyle = { transform: `rotate(45deg)` }; return <View className="xc-list-item" onClick={this.handleClick}> <View className="xc-list-item__wrap"> <View className="xc-list-item__content">{this.props.children}</View> {arrow && <View className="xc-list-item__action"> <View className="xc-list-item__arrow" style={arrowStyle} /> </View>} <View className="xc-list-item__border" /> </View> </View>; } handleClick = () => { const { onClick, disable } = this.props; !disable && onClick && onClick(); }; } export default XcListItem;