<div id="btn">
  <button v-on:click="aisatsu">押してちょ</button>
</div>
var btn = new Vue({
  el: '#btn',
  data: {
    name: 'びゅう'
  },

  methods: {
    aisatsu: function () {
      alert("こんにちは " + this.name + '!')
    }
  }
})

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.16/vue.min.js