title: How to implement dirty state in VueJs
body: <p>I am new to VueJs and I am working on a form that I want to enable the <code>Save</code> button only when a change occurs at the model.</p>
  
  <p>My initial thought is to <code>compute</code> a dirty function comparing the initial model with the current.</p>
  
  <blockquote>
    <p><strong>Note:</strong> This code is not tested, it's here just for an example.</p>
  </blockquote>
  
  <pre><code>var app = new Vue({
      el: '#app',
      data: {a:0, b:'', c:{c1:null, c2:0, c3:'test'}},
      initialData: null,
      mounted():{ initialData = JSON.parse(JSON.stringify(data));},
      computed: {
          isDirty: function () {
            return JSON.stringify(data) === JSON.stringify(initialData) 
          }
      }
  });
  </code></pre>
  
  <p>Is there a better way of doing this or is there any improvement you could suggest on the above-mentioned code?</p>