Vue’s Transitions don’t seem to work when you refresh your browser.
JavaScript
x
22
22
1
<transition
2
v-on:before-enter="beforeEnter"
3
v-on:enter="enter"
4
v-on:leave="leave"
5
>
6
<!-- -->
7
</transition>
8
9
methods: {
10
beforeEnter: function (el) {
11
console.log('before enter')
12
},
13
enter: function (el, done) {
14
console.log('enter')
15
done()
16
},
17
leave: function (el, done) {
18
console.log('leave')
19
done()
20
}
21
}
22
For instance, when I click to go to http://myvue.com/#/foo I get the transitions and all the console logs. But I don’t get the transitions and the logs when I refresh my browser on http://myvue.com/#/foo
Any ideas?
Advertisement
Answer
JavaScript
1
9
1
<transition
2
appear
3
v-on:before-enter="beforeEnter"
4
v-on:enter="enter"
5
v-on:leave="leave"
6
>
7
<!-- -->
8
</transition>
9