Skip to content

Commit 2e39e90

Browse files
committed
fix(TreeSelect):优化样式
1 parent 4b7df45 commit 2e39e90

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

example/examples/src/routes/TreeSelect/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default class TreeSelectDemo extends React.Component<TreeSelectViewProps>
101101
<Body>
102102
<TreeSelect
103103
defaultValue={['01', '01-1']}
104-
// activeColor="#fd8a00"
104+
activeColor="#fd8a00"
105105
options={option}
106106
onChange={(value: any, nodes: any) => {
107107
console.log(value, nodes);

packages/core/src/TreeSelect/styles.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ import { StyleSheet } from 'react-native';
33
export const style = StyleSheet.create({
44
item: {
55
minHeight: 50,
6-
paddingVertical: 6,
7-
paddingHorizontal: 12,
8-
position: 'relative',
96
display: 'flex',
107
alignItems: 'center',
118
justifyContent: 'center',

packages/core/src/TreeSelect/tree-select.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export const TreeSelect: FC<TreeSelectProps> = (p) => {
5050
});
5151
}
5252
traverse(undefined, props.options);
53-
5453
return [deep, optionsMap, optionsParentMap];
5554
}, [props.options]);
5655

@@ -82,7 +81,7 @@ export const TreeSelect: FC<TreeSelectProps> = (p) => {
8281
onItemSelect(item);
8382
}
8483
}}
85-
style={style.item}
84+
style={[style.item, isActive ? { backgroundColor: '#fff' } : {}]}
8685
>
8786
<Text style={isActive ? { color: props.activeColor, fontWeight: 'bold' } : {}}>{item[labelName]}</Text>
8887
</TouchableOpacity>
@@ -103,7 +102,7 @@ export const TreeSelect: FC<TreeSelectProps> = (p) => {
103102
width = `66.67%`;
104103
}
105104
const column = (
106-
<ScrollView key={i} style={{ width, flex: 1 }}>
105+
<ScrollView key={i} style={{ width, flex: 1, backgroundColor: '#fff' }}>
107106
{renderItems(i === 0 ? props.options : optionsMap.get(value[i - 1])?.[childrenName], i)}
108107
</ScrollView>
109108
);

0 commit comments

Comments
 (0)