<div id="app">
  Type the first number:
  <input type="number" v-model.number="n1"><br />
  Type the second number:
  <input type="number" v-model.number="n2"><br />
  <button v-on:click="sum(n1,n2)">Sum</button><br />
  The sum is: {{ ans }}
</div>
var vue = new Vue({
  el: "#app",
  data: {
    n1: 0,
    n2: 0,
    ans: 0
  },
  methods: {
    sum: function(a, b) {
      this.ans = a + b;
    }
  }
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

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