Skip to content

After calling $destroy (), @ click binding events still exist #7086

@git8023

Description

@git8023

Version

2.5.1

Reproduction link

https://gitee.com/osby/learn-js/blob/master/vue/example/9/vue.live.html
http://jsfiddle.net/0bxfga8q/

Steps to reproduce

<div id="app">
    <p>{{result}}</p>
    <p>
        <button @click="change">Change</button>
        <button @click="destroy">Destroy</button>
    </p>
</div>
    var app = new Vue({
        el: "#app",
        data: {
            message: "Hello World",
            result: ""
        },
        methods: {
            change: function () {
                this.result = this.message   " - "   new Date().toLocaleString();
                throw "123";
            },
            destroy: function () {
                this.$destroy();
            }
        });

Click button:Destroy, and click button:Change.

What is expected?

Hope in the calling $destroy(), remove the DOM event object. To prevent invalid Ajax requests.
thanks very much.

What is actually happening?

The console output information: Uncaught 123


Asynchronous validation event in the form.

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