Browse Source

remove unnecessary appear check in v-show (fix #3559)

Evan You 9 years ago
parent
commit
a00170cbb9

+ 1 - 1
src/platforms/web/runtime/directives/show.js

@@ -14,7 +14,7 @@ export default {
   bind (el: any, { value }: VNodeDirective, vnode: VNodeWithData) {
   bind (el: any, { value }: VNodeDirective, vnode: VNodeWithData) {
     vnode = locateNode(vnode)
     vnode = locateNode(vnode)
     const transition = vnode.data && vnode.data.transition
     const transition = vnode.data && vnode.data.transition
-    if (value && transition && transition.appear && !isIE9) {
+    if (value && transition && !isIE9) {
       enter(vnode)
       enter(vnode)
     }
     }
     const originalDisplay = el.style.display === 'none' ? '' : el.style.display
     const originalDisplay = el.style.display === 'none' ? '' : el.style.display

+ 1 - 0
test/unit/features/transition/transition.spec.js

@@ -504,6 +504,7 @@ if (!isIE9) {
       // should not apply transition on initial render by default
       // should not apply transition on initial render by default
       expect(vm.$el.textContent).toBe('foo')
       expect(vm.$el.textContent).toBe('foo')
       expect(vm.$el.children[0].style.display).toBe('')
       expect(vm.$el.children[0].style.display).toBe('')
+      expect(vm.$el.children[0].className).toBe('test')
       vm.ok = false
       vm.ok = false
       waitForUpdate(() => {
       waitForUpdate(() => {
         expect(vm.$el.children[0].className).toBe('test test-leave test-leave-active')
         expect(vm.$el.children[0].className).toBe('test test-leave test-leave-active')