Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

256
Views
Does the Vue instance loses its old properties?

Does the browser keep showing Vue instance properties even when they no longer exist? Because I've tried to set the instance to 4 making it a number but still the old data and methods don't disappear from the browser

var r = new Vue({
    el: "#test", //gets the element with id test
    data: {
        h2: "saned",
        ha: "<h3>this shit sucks</h3>",
        imgsrc: "image.jpg",
    }, //data section
    methods: {
        fun: function () {
            return "i am " + this.h2;
        },
    }, //functions section
});
r = 4; //the previous data won't dissapear

I want to understand how does it exactly work, because I've thought that since the object is no longer a Vue instance the previous instance data should disappear, I was hoping to put a pic showing how it stays, but I can't since it'll be a link anyway and the post won't be good.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Here you created the Vue instance and made r point to it:

var r = new Vue({})

Here you assigned a new value to r:

r=4;

Though you now have stopped r from pointing to it, the Vue instance itself stays untouched and hasn't been destroyed.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!