diff --git a/src/slider/slick/arrow.jsx b/src/slider/slick/arrow.jsx index e8f9b6610e..91ed67749e 100644 --- a/src/slider/slick/arrow.jsx +++ b/src/slider/slick/arrow.jsx @@ -51,9 +51,9 @@ export default class Arrow extends Component { } // 下一个 index 大于总数?? - if (slideCount <= slidesToShow) { - return true; - } + // if (slideCount <= slidesToShow) { + // return true; + // } // 向前箭头:当前是第 0 个 if (type === 'prev') { diff --git a/test/slider/index-spec.js b/test/slider/index-spec.js index 277e9ac4a4..69e294919e 100644 --- a/test/slider/index-spec.js +++ b/test/slider/index-spec.js @@ -361,6 +361,23 @@ describe('slider', function () { }); }); + it('should have correct disabled class for next/prev arrow', () => { + return co(function* () { + wrapper = mount({slides}); + yield delay(100); + assert( + wrapper.find('.next-slick-arrow.next-slick-next').at(0).hasClass('disabled') + ); + assert( + !wrapper.find('.next-slick-arrow.next-slick-prev').at(0).hasClass('disabled') + ); + }); + }); + it('should hover next/prev arrow', () => { return co(function* () { wrapper = mount({slides});