12345678910111213141516171819202122232425 |
-
- import React from 'react'
- import { View, Image, Text } from '@tarojs/components'
- import './style.less'
-
- export default (props) => {
- const { icon, text, onClick } = props
-
-
- const handleClick = (e) => {
- if (onClick) {
- e.stopPropagation()
- onClick(e);
- }
- }
-
- return (
- <View className='cpn-action cpn-icon-action'>
- <View onClick={handleClick}>
- <Image src={icon} />
- {text?<Text>{text}</Text>:null}
- </View>
- </View>
- )
- }
|