diff --git a/example/components/input-option/input-option.vue b/example/components/input-option/input-option.vue new file mode 100644 index 000000000..a9374d34f --- /dev/null +++ b/example/components/input-option/input-option.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/example/components/select-option/select-option.vue b/example/components/select-option/select-option.vue new file mode 100644 index 000000000..fb700dd7d --- /dev/null +++ b/example/components/select-option/select-option.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/example/components/switch-option/switch-option.vue b/example/components/switch-option/switch-option.vue new file mode 100644 index 000000000..6a9e562a0 --- /dev/null +++ b/example/components/switch-option/switch-option.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/example/data/ease.js b/example/data/ease.js new file mode 100755 index 000000000..006689387 --- /dev/null +++ b/example/data/ease.js @@ -0,0 +1,23 @@ +export const ease = { + // easeOutQuint + swipe: { + style: 'cubic-bezier(0.23, 1, 0.32, 1)', + fn: function (t) { + return 1 + (--t * t * t * t * t) + } + }, + // easeOutQuard + swipeBounce: { + style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)', + fn: function (t) { + return t * (2 - t) + } + }, + // easeOutQuart + bounce: { + style: 'cubic-bezier(0.165, 0.84, 0.44, 1)', + fn: function (t) { + return 1 - (--t * t * t * t) + } + } +} diff --git a/example/pages/scroll.vue b/example/pages/scroll.vue index b34e7e363..dae8690b3 100644 --- a/example/pages/scroll.vue +++ b/example/pages/scroll.vue @@ -1,40 +1,107 @@ diff --git a/src/components/scroll/scroll.vue b/src/components/scroll/scroll.vue index 02e44bc51..0b3a8838e 100644 --- a/src/components/scroll/scroll.vue +++ b/src/components/scroll/scroll.vue @@ -128,11 +128,11 @@ }, mounted() { setTimeout(() => { - this._initScroll() + this.initScroll() }, 20) }, methods: { - _initScroll() { + initScroll() { if (!this.$refs.wrapper) { return } @@ -181,6 +181,9 @@ refresh() { this.scroll && this.scroll.refresh() }, + destroy() { + this.scroll.destroy() + }, scrollTo() { this.scroll && this.scroll.scrollTo.apply(this.scroll, arguments) },