Browse Source

fix: should pass prefixCls correctly

pull/3050/head
Benjy Cui 8 years ago
parent
commit
59093a6586
  1. 7
      components/affix/index.tsx
  2. 10
      components/cascader/index.tsx
  3. 1
      components/table/Table.tsx

7
components/affix/index.tsx

@ -2,8 +2,8 @@ import * as React from 'react';
import * as ReactDOM from 'react-dom';
import addEventListener from 'rc-util/lib/Dom/addEventListener';
import classNames from 'classnames';
import assign from 'object-assign';
import shallowequal from 'shallowequal';
import omit from 'omit.js';
function getScroll(target, top) {
const prop = top ? 'pageYOffset' : 'pageXOffset';
@ -220,10 +220,7 @@ export default class Affix extends React.Component<AffixProps, any> {
[this.props.prefixCls]: this.state.affixStyle,
});
const props = assign({}, this.props);
delete props.offsetTop;
delete props.offsetBottom;
delete props.target;
const props = omit(this.props, ['prefixCls', 'offsetTop', 'offsetBottom', 'target']);
return (
<div {...props} style={this.state.placeholderStyle}>

10
components/cascader/index.tsx

@ -234,15 +234,15 @@ export default class Cascader extends React.Component<CascaderProps, any> {
render() {
const props = this.props;
const state = this.state;
const [{ prefixCls, children, placeholder, size, disabled,
const [{ prefixCls, inputPrefixCls, children, placeholder, size, disabled,
className, style, allowClear, showSearch }, otherProps] = splitObject(props,
['prefixCls', 'children', 'placeholder', 'size', 'disabled', 'className',
'style', 'allowClear', 'showSearch']);
['prefixCls', 'inputPrefixCls', 'children', 'placeholder', 'size', 'disabled',
'className', 'style', 'allowClear', 'showSearch']);
const value = state.value;
const sizeCls = classNames({
[`${props.inputPrefixCls}-lg`]: size === 'large',
[`${props.inputPrefixCls}-sm`]: size === 'small',
[`${inputPrefixCls}-lg`]: size === 'large',
[`${inputPrefixCls}-sm`]: size === 'small',
});
const clearIcon = (allowClear && !disabled && value.length > 0) || state.inputValue ?
<Icon type="cross-circle"

1
components/table/Table.tsx

@ -850,6 +850,7 @@ export default class Table extends React.Component<TableProps, any> {
let table = (
<RcTable {...restProps}
prefixCls={prefixCls}
data={data}
columns={columns}
className={classString}

Loading…
Cancel
Save