Skip to content

Multiple arguments in custom directives #862

@thetutlage

Description

@thetutlage

I wanted to build a form element directive based upon arguments passed to it while calling.

<div v-form-element="label:Name,type:text"></div>

Now i need some way to extract arguments as an object, where the current api is not working for me. This is what i have tried so far.

Vue.directive('form-element',{
   bind: function(){
      console.log(this.arg);
   }
});

and it returns label only

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