title: vue.js proper way to determine empty object
body: <p>Classic scenario: I want to display a list, but when it's empty I want to display "No data".</p>
  
  <p>The fact that it is somewhat complicated to do something I would expect to be simple makes me think I'm probably doing it wrong.</p>
  
  <p>Here is my current solution.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://cdn.jsdelivr.net/vue/1.0.16/vue.js"&gt;&lt;/script&gt;
  
  &lt;div id="element"&gt;
    &lt;div v-if="empty"&gt;No item in inventory&lt;/div&gt;
    &lt;div v-for="(index, item) in inventory"&gt;
      {{item.key}}&lt;button onclick="remove('{{index}}')"&gt;remove&lt;/button&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  "use strict";
  var vm;
  $(function() {
      vm = new Vue({
          el: '#element',
          data: {
              inventory: {"id1" : {"key" : "val1"}, "id2" : {"key" : "val2"}},
              empty: false
          },
          watch: {
              inventory: function() {
                  vm.empty = $.isEmptyObject(vm.inventory);
              }
          }
      });
  });
  
  function remove(key) {
    Vue.delete(vm.inventory, key);
  }
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Is there a better solution than this?</p>