Skip to content

Commit 3fc1205

Browse files
committed
moved to vue transitions properly
1 parent 7c47b16 commit 3fc1205

File tree

3 files changed

+37
-16
lines changed

3 files changed

+37
-16
lines changed

README.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,43 @@ not-dismissable| Boolean | false | will be not close on click outside of menu (o
3737
close-on-click | Boolean | false | will be closed on click inside of menu
3838
click-to-toggle | Boolean | false | opens on click instead of hover
3939
is-opened | Boolean | false | (two-way) set to open / close
40-
transition | String | - | name of vue transition
40+
transition | String | - | name of a vue transition. [Detailed description](#transition)
4141

4242
#### Events
4343
Name | description
4444
---:| ---
45-
before-open | will be called before open animation
46-
opened | will be called when opened
47-
before-close | will be called before close animation
48-
closed | will be called when closed
45+
before-enter | will be called before open animation
46+
after-enter | will be called when opened
47+
before-leave | will be called before close animation
48+
after-leave | will be called when closed
4949

50-
When a transition is given, it must emit the `opened` and `closed` events.
50+
#### Transition
51+
52+
You can provide a vue transition like this:
53+
```js
54+
Vue.transition("fade",{
55+
// your transition
56+
})
57+
// or in the instance:
58+
transitions: {
59+
fade: {
60+
// your transition
61+
}
62+
}
63+
// usage:
64+
template: "<fab transition='fade'></fab>"
65+
```
66+
67+
68+
## Changelog
69+
70+
- 1.1.0
71+
moved transition to `vue-transitions` properly
72+
events are renamed after vue transitions
73+
74+
- 1.0.0
75+
moved transition to `vue-transitions`
76+
changed element from `span` to `a`
5177

5278
# Development
5379
Clone repository.
@@ -57,11 +83,6 @@ npm run dev
5783
```
5884
Browse to `http://localhost:8080/`.
5985

60-
## Changelog
61-
- 1.0.0
62-
moved transition to `vue-transitions`
63-
changed element from `span` to `a`
64-
6586
## License
6687
Copyright (c) 2016 Paul Pflugradt
6788
Licensed under the MIT license.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"node": "*"
1818
},
1919
"dependencies": {
20-
"vue-mixins": "^0.2.14"
20+
"vue-mixins": "^0.2.17"
2121
},
2222
"peerDependencies": {},
2323
"devDependencies": {
@@ -26,7 +26,7 @@
2626
"coffee-loader": "^0.7.2",
2727
"coffee-script": "^1.10.0",
2828
"gh-pages": "^0.11.0",
29-
"karma": "^1.2.0",
29+
"karma": "^1.3.0",
3030
"karma-chai": "^0.1.0",
3131
"karma-chai-dom": "^1.1.0",
3232
"karma-chai-spies": "^0.1.4",

src/fixed-action-button.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ div(
77
@mouseleave="onUnhover",
88
:class="computedClass"
99
)
10-
ul(v-if="opened",v-el:fab, v-bind:transition="transition",v-bind:style="fabStyle")
10+
ul(v-if="opened",v-el:fab, v-bind:transition="cTransition",v-bind:style="fabStyle")
1111
slot
1212
a(@click="onFabClick")
1313
slot(name="fab")
@@ -21,6 +21,7 @@ module.exports =
2121
require("vue-mixins/isOpened")
2222
require("vue-mixins/style")
2323
require("vue-mixins/class")
24+
require("vue-mixins/transition")
2425
]
2526
2627
@@ -38,12 +39,11 @@ module.exports =
3839
"notDismissable":
3940
type: Boolean
4041
default: false
41-
"transition":
42-
type: String
4342
4443
computed:
4544
mergeStyle: -> position:"fixed"
4645
fabStyle: -> []
46+
4747
methods:
4848
onHover: ->
4949
@open() unless @clickToToggle

0 commit comments

Comments
 (0)