Skip to content

genChildren function with error normalizationType #9181

@skyline0705

Description

@skyline0705

Version

2.5.19

Reproduction link

https://codepen.io/anon/pen/roaKMY

Steps to reproduce

open the link and open the console

What is expected?

console should not has error, and the result in dom should be empty

What is actually happening?

console shows "Cannot read property 'length' of undefined
​ at simpleNormalizeChildren"


before the version 2.5.16, it works fine, and I saw the source, when compile the template, function genChildren choose an error normalizationType, it should be ALWAYS_NORMALIZE.

and I think there is something wrong when compiling v-for and component with an "undefined" list because I find this words in 'src/core/vdom/helpers/normalize-children.js':

// 2. When the children contains constructs that always generated nested Arrays,
// e.g. <template>, <slot>, v-for, or when the children is provided by user
// with hand-written render functions / JSX. In such cases a full normalization
// is needed to cater to all possible types of children values.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions