mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 17:51:54 +00:00
waterfall specs
This commit is contained in:
49
test/unit/components/waterfall.vue
Normal file
49
test/unit/components/waterfall.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<script>
|
||||
import Waterfall from 'packages/waterfall';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
disabled: Boolean,
|
||||
list: Array,
|
||||
onWaterfallLower: {
|
||||
type: Function,
|
||||
default() {
|
||||
return function() {};
|
||||
}
|
||||
},
|
||||
onWaterfallUpper: {
|
||||
type: Function,
|
||||
default() {
|
||||
return function() {};
|
||||
}
|
||||
}
|
||||
},
|
||||
directives: {
|
||||
WaterfallLower: Waterfall('lower'),
|
||||
WaterfallUpper: Waterfall('upper')
|
||||
},
|
||||
methods: {
|
||||
triggerWaterfallLower() {
|
||||
console.log('waterfall lower trigger');
|
||||
this.onWaterfallLower();
|
||||
},
|
||||
triggerWaterfallUpper() {
|
||||
console.log('waterfall upper trigger');
|
||||
this.onWaterfallUpper();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
v-waterfall-lower="triggerWaterfallLower"
|
||||
v-waterfall-upper="triggerWaterfallUpper"
|
||||
waterfall-disabled="disabled"
|
||||
>
|
||||
<div
|
||||
v-for="item in list"
|
||||
class="waterfall-item"
|
||||
>{{ item.id }}</div>
|
||||
</div>
|
||||
</template>
|
Reference in New Issue
Block a user