Skip to content

Commit c5f341c

Browse files
committed
Merge branch 'develop'
2 parents a6863f0 + 6b9d94f commit c5f341c

File tree

7 files changed

+21
-27
lines changed

7 files changed

+21
-27
lines changed

@types/tag.d.ts

-6
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ export interface IProps {
1919
* 可选参数 `small`, `normla`
2020
*/
2121
size?: 'small' | 'normal';
22-
/**
23-
* 是否可以点击
24-
*
25-
* 默认值 `false`
26-
*/
27-
canTouch?: boolean;
2822
/**
2923
* 点击事件
3024
*/

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mp-colorui",
3-
"version": "0.5.1",
3+
"version": "0.5.2",
44
"description": "MP ColorUI 是一款基于 Taro 框架并且联合 Color-UI CSS 库开发的多端 UI 组件库(支持小程序端和H5端)",
55
"keywords": [
66
"taro",

src/components/accordion/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {View} from '@tarojs/components';
33

44
import {IProps} from '../../../@types/accordion'
55
import ClIcon from "../icon";
6+
import { screenPercent } from '../utils';
67

78
export default function ClAccordion(props: IProps) {
89
const {open, title, animation, onClick, card} = props;
@@ -24,7 +25,7 @@ export default function ClAccordion(props: IProps) {
2425
return (
2526
<View className={`cu-list menu ${card ? 'card-menu' : ''}`} style={{
2627
overflow: "hidden",
27-
height: pxTransform((50 + height) * 2),
28+
height: pxTransform(98 + height / screenPercent),
2829
transition: `all ${animation ? `${props.speed}s` : 0} linear`,
2930
color: 'black'
3031
}}>

src/components/radio/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ export default function ClRadio(props: IProps) {
5050

5151
const weappComponent = type === 'list' ? renderListComponent() : formOrNormalComponent;
5252

53-
const RadioComponent = !isWeApp ?
54-
<H5Radio {...props} /> : weappComponent;
53+
const RadioComponent = !isWeApp ? <H5Radio {...props} /> : weappComponent;
5554

5655
return (
57-
RadioComponent
56+
<View>
57+
{RadioComponent}
58+
</View>
5859
);
5960
}
6061

src/components/select/index.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ function ClSelect(props: IProps) {
6060
const value: string = getSelectorValue(index);
6161
setSelected(value);
6262
};
63-
useMemo(() => {
64-
props.mode === 'selector' && setSelected(getSelectorValue(selector.value))
65-
props.mode === 'multiSelector' && setMutiSelected(getMutiSelectorValue(mutiSelector.value))
66-
}, [props.selector])
6763
// 多选
6864
const getMutiSelectorValue = mutiIndex => {
6965
const value: any[] = [];
@@ -173,7 +169,10 @@ function ClSelect(props: IProps) {
173169
}
174170
setTempSelect(tempSelect)
175171
}
176-
172+
useMemo(() => {
173+
props.mode === 'selector' && setSelected(getSelectorValue(selector.value))
174+
props.mode === 'multiSelector' && setMutiSelected(getMutiSelectorValue(mutiSelector.value))
175+
}, [props.selector])
177176
// 单选组件
178177
const selectorComponent = (
179178
<Picker

src/components/tag/index.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export default class ClTag extends Component<IProps, IState> {
1515
static defaultProps = {
1616
shape: 'normal',
1717
size: 'normal',
18-
canTouch: false,
1918
tags: []
2019
} as IProps;
2120
onClick(index: number) {

src/pages/index/index.tsx

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ import ClSwiperAction from '../../components/swiperAction/index';
2323
import ClActionSheet from '../../components/actionSheet/index';
2424
import ClCurtain from '../../components/curtain/index';
2525
import ClTabs from '../../components/tabs'
26+
import ClRadio from '../../components/radio';
2627

2728
export default function Index() {
28-
const tabs = [...Array(50)].map((key, index) => ({ name: 'tab-' + index, id: 'id-' + index }))
29+
const radioGroup = [{
30+
key: '男生',
31+
value: 'male'
32+
}, {
33+
key: '女生',
34+
value: 'female'
35+
}]
36+
const [checkedValue, setCheckedValue] = useState('male')
2937
return (
3038
<View>
31-
<ClVerticalTab tabs={tabs} height={1000}>
32-
<View>
33-
{tabs.map((item) => (
34-
<View id={item.id} key={item.name}>
35-
<ClVerticalTabCell>{item.name}</ClVerticalTabCell>
36-
</View>
37-
))}
38-
</View>
39-
</ClVerticalTab>
39+
<ClRadio type='normal' title='normal' radioGroup={radioGroup} checkedValue={checkedValue} />
4040
</View>
4141
)
4242
}

0 commit comments

Comments
 (0)