The scope of the Vue object

Code written by colleagues

function tableVue(tableData){
    var tableData = tableData;
    /* vue */
    var tableV = new Vue({  
        el: "-sharptable",
        data: {
            item:[]
        },
        mounted: function () {
            // 
            this.item = tableData;
        }
    });
}

then call this tableVue function when the page is initialized, and it works. But isn"t this tableV a local variable? Won"t virtual DOM nodes be destroyed with the destruction of this variable?


the virtual DOM node references the tableData, so if the virtual DOM node is not destroyed, the tableData will not be destroyed.

so there is no logic like tableData destruction, virtual dom destruction.

Menu