diff --git a/src/pagination/pagination.jsx b/src/pagination/pagination.jsx index 749211e436..12b9996592 100644 --- a/src/pagination/pagination.jsx +++ b/src/pagination/pagination.jsx @@ -20,6 +20,7 @@ class Pagination extends Component { prefix: PropTypes.string, pure: PropTypes.bool, rtl: PropTypes.bool, + device: PropTypes.oneOf(['desktop', 'tablet', 'phone']), className: PropTypes.string, /** * 自定义国际化文案对象 @@ -579,7 +580,8 @@ class Pagination extends Component { prefix, pure, rtl, - type, + device, + type: paginationType, size, shape, className, @@ -612,6 +614,12 @@ class Pagination extends Component { const sizeSelector = this.renderPageSizeSelector(); const isStart = pageSizePosition === 'start'; + let type = paginationType; + + if (device === 'phone' && type === 'normal') { + type = 'simple'; + } + const classes = cx({ [`${prefix}pagination`]: true, [`${prefix}${size}`]: size, diff --git a/test/pagination/index-spec.js b/test/pagination/index-spec.js index dd948e2421..7d69d27dbc 100644 --- a/test/pagination/index-spec.js +++ b/test/pagination/index-spec.js @@ -680,4 +680,13 @@ describe('Pagination', () => { ) ); }); + + it('should support device transfer type to simple', () => { + wrapper.setProps({ + device: 'phone', + type: 'normal' + }); + + assert(wrapper.find('.next-simple').length > 0); + }) });