<p>今何時(なんどき)でっか?</p>
<div id="btn">
  <button v-on:click="say('おはようございます')">朝だ</button>
  <button v-on:click="say('こんにちは')">昼だ</button>
  <button v-on:click="say('こんばんは')">夜だ</button>
</div>
var btn = new Vue({
  el: '#btn',
  data: {
    name: ' びゅう'
  },
  methods: {
    say: function (message) {
      alert(message + 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