diff --git a/.travis.yml b/.travis.yml index 023fc105cd..7bddda9858 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ node_js: cache: directories: + - $HOME/.npm - node_modules matrix: diff --git a/components/avatar/style/index.less b/components/avatar/style/index.less index bea8f554c1..9caf009598 100644 --- a/components/avatar/style/index.less +++ b/components/avatar/style/index.less @@ -43,7 +43,7 @@ width: @size; height: @size; line-height: @size; - border-radius: @size / 2; + border-radius: 50%; & > * { line-height: @size; diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 9d8e061c55..54328b19f1 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -104,6 +104,7 @@ export default class Table extends React.Component, TableState< store: Store; columns: ColumnProps[]; components: TableComponents; + row: React.ComponentType; constructor(props: TableProps) { super(props); @@ -922,13 +923,16 @@ export default class Table extends React.Component, TableState< createComponents(components: TableComponents = {}, prevComponents?: TableComponents) { const bodyRow = components && components.body && components.body.row; const preBodyRow = prevComponents && prevComponents.body && prevComponents.body.row; - if (!this.components || bodyRow !== preBodyRow) { - this.components = { ...components }; - this.components.body = { - ...components.body, - row: createBodyRow(bodyRow), - }; + if (!this.row || bodyRow !== preBodyRow) { + this.row = createBodyRow(bodyRow); } + this.components = { + ...components, + body: { + ...components.body, + row: this.row, + }, + }; } renderTable = (contextLocale: TableLocale, loading: SpinProps) => { diff --git a/components/table/__tests__/Table.test.js b/components/table/__tests__/Table.test.js index a535eeb63f..269049f608 100644 --- a/components/table/__tests__/Table.test.js +++ b/components/table/__tests__/Table.test.js @@ -77,4 +77,12 @@ describe('Table', () => { wrapper.update(); expect(wrapper.find('.ant-spin')).toHaveLength(1); }); + + it('renders custom components correctly when it changes', () => { + const BodyWrapper1 = props => ; + const BodyWrapper2 = props => ; + const wrapper = mount(); + wrapper.setProps({ components: { body: { wrapper: BodyWrapper2 } } }); + expect(wrapper.find('tbody').props().id).toBe('wrapper2'); + }); }); diff --git a/components/timeline/demo/custom.md b/components/timeline/demo/custom.md index d2c5f1c736..10ceb6c9e4 100644 --- a/components/timeline/demo/custom.md +++ b/components/timeline/demo/custom.md @@ -1,6 +1,6 @@ --- order: 4 -title: +title: zh-CN: 自定义时间轴点 en-US: Custom --- @@ -9,7 +9,7 @@ title: 可以设置为图标或其他自定义元素。 -## en-US +## en-US Set a node as an icon or other custom element. diff --git a/components/timeline/style/index.less b/components/timeline/style/index.less index a0cc2aca17..efc6d77598 100644 --- a/components/timeline/style/index.less +++ b/components/timeline/style/index.less @@ -65,13 +65,13 @@ border-radius: 0; padding: 3px 1px; transform: translate(-50%, -50%); - top: 5px; + top: 5.5px; left: 5px; width: auto; } &-content { - padding: 0 0 0 18px; + margin: 0 0 0 18px; position: relative; top: -(@font-size-base * @line-height-base - @font-size-base) + 1px; }