<div id="watch-example">
  <p>
    Start writing:
    <input v-model="text">
  </p>
  <p>{{ result }}</p>
</div>
var watchExampleVM = new Vue({
  el: '#watch-example',
  data: {
    text: '',
    result: 'Waiting for changes...',
  },
  watch: {
    text: function (newValue, oldValue) {
        this.result = newValue
    }
  },
})

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

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