We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bbf5e59 commit d6ee905Copy full SHA for d6ee905
src/directives/public/show.js
@@ -1,4 +1,4 @@
1
-import { getAttr } from '../../util/index'
+import { getAttr, inDoc } from '../../util/index'
2
import { applyTransition } from '../../transition/index'
3
4
export default {
@@ -19,8 +19,13 @@ export default {
19
},
20
21
apply (el, value) {
22
- applyTransition(el, value ? 1 : -1, function () {
+ if (inDoc(el)) {
23
+ applyTransition(el, value ? 1 : -1, toggle, this.vm)
24
+ } else {
25
+ toggle()
26
+ }
27
+ function toggle () {
28
el.style.display = value ? '' : 'none'
- }, this.vm)
29
30
}
31
0 commit comments