Skip to content

Commit

Permalink
feat: 全部组件支持 className 属性
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Apr 2, 2019
1 parent 7ba07b2 commit d9c45fc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/Picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ class MPicker extends component({
}

render() {
const { maskClosable, data, itemHeight, visibleItemCount, noCancel, cancelText, confirmText, title } = this.props
const { maskClosable, data, itemHeight, visibleItemCount, noCancel, cancelText, confirmText, title, className } = this.props
const { localVisible, localSelectedIndexes } = this.state
return (
<View>
<View className={className}>
<View onClick={this.handleTriggerClick}>
{this.props.children}
</View>
Expand Down
4 changes: 2 additions & 2 deletions src/components/PickerView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,13 @@ export default class MPickerView extends component({
}

render() {
const { disabled } = this.props
const { disabled, className } = this.props
const { normalizedData, localSelectedIndexes } = this.state
const styles = this.computeStyles()
return (
<PickerView
value={localSelectedIndexes}
className={`m-picker-view ${disabled && 'm-picker-view_disabled'}`}
className={`m-picker-view ${disabled && 'm-picker-view_disabled'} ${className}`}
style={styles.view}
indicatorStyle={`height:${styles.indicator.height}`}
onPickStart={this.props.onPickStart}
Expand Down
2 changes: 2 additions & 0 deletions src/components/SinglePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class MSinglePicker extends component({
cancelText,
confirmText,
title,
className,
} = this.props
const {
localData,
Expand All @@ -90,6 +91,7 @@ class MSinglePicker extends component({
cancelText={cancelText}
confirmText={confirmText}
title={title}
className={className}
onCancel={this.handleCancel}
onConfirm={this.handleConfirm}>
{this.props.children}
Expand Down
3 changes: 2 additions & 1 deletion src/components/Sticky/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ export default class MSticky extends component({
}

render() {
const { className } = this.props
const { fixed, contentHeight } = this.state
return (
<View
className={`m-sticky ${fixed && 'm-sticky_fixed'}`}
className={`m-sticky ${fixed && 'm-sticky_fixed'} ${className}`}
style={contentHeight ? { height: `${contentHeight}px` } : {}}>
<View className='m-sticky__content'>
{this.props.children}
Expand Down

0 comments on commit d9c45fc

Please sign in to comment.