Skip to content

Support using result of Vue.extend in mixins #5652

Closed
@strantr

Description

@strantr

Version

2.3.3

Reproduction link

http://jsfiddle.net/zna06rq4/1/

Steps to reproduce

Run fiddle, error will be shown in console:

Error in callback for watcher "hello": "TypeError: this.cb.call is not a function"

What is expected?

"child" should be logged to the console via the watch handler in Child.

What is actually happening?

The watch is not being fired


In strats.watch (

: [child]
) the function unconditionally converts child to an array.
If this has already been converted to an array (via a previous merge operation) it will convert it to a nested array [[child]].

The fix for this seems to be updating line 175 to have:
Array.isArray(child) ? child : [child]

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