Skip to content

Inject/Provide not working in Vue.extend() class. #6436

@SpringNyan

Description

@SpringNyan

Version

2.4.2

Reproduction link

https://jsfiddle.net/50wL7mdz/55826/

Steps to reproduce

  1. Use Vue.extend() to create a subclass which contains provide option.
  2. Inject property in child component of subclass.

What is expected?

Property is injected correctly.

What is actually happening?

Property is not injected.


In src/core/util/options.js, Line 97-99. defaultData is set to undefined if parentVal is not a function. It may cause this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions