Skip to content

How to access global functions in component markup #2417

@ajorias

Description

@ajorias

I'm not able to access global functions in the markup of a component.

var mySingleton = { myFunction : function() { } }

<my_component v-on:click="mySingleton.myFunction()"></my_component>

mySingleton will be UNDEFINED because of:

(function(scope /**/) { return scope.window.mySingleton.myFunction(); })

If I try to access via

<my_component v-on:click="window.mySingleton.myFunction()""></my_component>`

It is still UNDEFINED because of:

(function(scope /**/) { return scope.window.mySingleton.myFunction(); })

Shouldn't at least case 2 work so that vue does not prepend scope. because I try to access window. ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions