Skip to content

may be a bug of twoWay directive #631

Closed
@suemi994

Description

@suemi994

When I define a twoWay directive and use set function in bind, there is an error 'can't read property set of undefined' , my code follows.

Vue.directive('tags',{
    twoWay:true,
    bind: function () {
        var self=this;
        console.log(self);
        $(self.el).on('itemAdded',function(){
             self.set($(this).val());
        });
    },

    unbind:function(){
        $(this.el).off();
    }
});

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