From bb16cf5b23166d79571c6010cd984e75e30bbe68 Mon Sep 17 00:00:00 2001 From: MopTym Date: Thu, 20 Oct 2016 23:55:27 +0800 Subject: [PATCH] v1.0.0 --- README.md | 20 ++++++++++++++++---- demo/horizontal-line.html | 18 +++++++++--------- demo/vertical-line.html | 18 +++++++++--------- lib/vue-waterfall.min.js | 4 ++-- lib/waterfall-slot.vue | 14 ++++++++------ lib/waterfall.vue | 26 +++++++++++++------------- package.json | 8 +++----- src/waterfall-slot.vue | 14 ++++++++------ src/waterfall.vue | 26 +++++++++++++------------- 9 files changed, 81 insertions(+), 67 deletions(-) diff --git a/README.md b/README.md index bbfb931..3deb1c8 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ A waterfall layout component for Vue.js . +Branch [0.x (version 0.x.x)](https://github.com/MopTym/vue-waterfall/tree/0.x) is compatible with Vue 1 . + ## Demo - [Vertical line](http://app.moptym.com/vue-waterfall/demo/vertical-line.html) @@ -187,7 +189,12 @@ new Vue({ order 0 - The order of slot, often be set to $index in v-for . + The order of slot, often be set to index in v-for . + + + key + '' + The unique identification of slot, required for transition. move-class @@ -201,23 +208,28 @@ new Vue({ Inspired by [vue-animated-list](https://github.com/vuejs/vue-animated-list) , vue-waterfall supports moving elements with `translate` in transition, click on the [demo](http://app.moptym.com/vue-waterfall/demo/vertical-line.html) page to see it. +vue-waterfall has not supported `` in Vue 2 ( [#10](https://github.com/MopTym/vue-waterfall/issues/10) ) . + ![preview](shuffle.gif) ## Events ```js -ON ( 'wf-reflow' ) { /* use 'wf-reflow' event to trigger reflow action */ +ON ( 'reflow' ) { reflow } +// trigger reflow action: waterfallVm.$emit('reflow') ``` ```js AFTER ( reflow ) { - broadcast 'wf-reflowed' - dispatch 'wf-reflowed' + emit 'reflowed' } +// waterfallVm.$on('reflowed', () => { console.log('reflowed') }) ``` +To + ## Reactivity ```js diff --git a/demo/horizontal-line.html b/demo/horizontal-line.html index 6d70e03..9911d51 100644 --- a/demo/horizontal-line.html +++ b/demo/horizontal-line.html @@ -22,21 +22,23 @@ :min-line-gap="180" :max-line-gap="220" :watch="items" + @reflowed="reflowed" + ref="waterfall" >
- + +