mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 03:11:15 +00:00
feat(Swipe): add resize method (#5070)
This commit is contained in:
@@ -11,7 +11,7 @@ export default createComponent({
|
||||
mixins: [
|
||||
TouchMixin,
|
||||
BindEventMixin(function(bind, isBind) {
|
||||
bind(window, 'resize', this.onResize, true);
|
||||
bind(window, 'resize', this.resize, true);
|
||||
|
||||
if (isBind) {
|
||||
this.initialize();
|
||||
@@ -154,7 +154,8 @@ export default createComponent({
|
||||
this.autoPlay();
|
||||
},
|
||||
|
||||
onResize() {
|
||||
// @exposed-api
|
||||
resize() {
|
||||
this.initialize(this.activeIndicator);
|
||||
},
|
||||
|
||||
@@ -252,6 +253,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
// @exposed-api
|
||||
swipeTo(index, options = {}) {
|
||||
this.swiping = true;
|
||||
this.resetTouchStatus();
|
||||
|
||||
Reference in New Issue
Block a user