<div id="app">
  <label for="product">Product X</label><br />
  <input type="number" v-model.number="items">
  <br />
  <p v-if="hasItems()">
    You order has {{ items }} items
  </p>
</div>
var app = new Vue({
  el: "#app",
  data: {
    items: 0
  },
  methods: {
    hasItems: function() {
      return this.items > 0;
    }
  }
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdn.jsdelivr.net/npm/vue/dist/vue.js