Browse Source

remove transition text node warn because the wrapped component may return empty nodes

dev
Evan You 8 years ago
parent
commit
63dd9d32e3
  1. 10
      src/platforms/web/runtime/components/transition.js

10
src/platforms/web/runtime/components/transition.js

@ -47,18 +47,8 @@ export default {
return return
} }
// warn text nodes
if (process.env.NODE_ENV !== 'production' &&
children.length === 1 && !children[0].tag) {
warn(
'<transition> can only be used on elements or components, not text nodes.',
this.$parent
)
}
// filter out text nodes (possible whitespaces) // filter out text nodes (possible whitespaces)
children = children.filter(c => c.tag) children = children.filter(c => c.tag)
if (!children.length) { if (!children.length) {
return return
} }

Loading…
Cancel
Save