Skip to content

How do you ensure a global is being set to child components from mount? #183

@d1820

Description

@d1820

I am mounting an instance of a component and I am setting the globals, when the component is rendered the child components dont have the global available. Am i missing something or doing it wrong?

I have tried

mount(component, { globals: { $myref: 'xxx' }});

and

const instance =  Vue.extend();
options.instance.prototype.$myref= 'xxx';
mount(component, options);

and

const instance =  Vue.extend();
options.instance.prototype.$myref= 'xxx';
options.globals = { $myref: 'xxx' };
mount(component, options);

in all the mounted component has $myref

but the child always shows undefined.

Any ideas or help would be great.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions