Answers for "method in vue component"

4

vue methods

<template>
  <div id="example">
    <button v-on:click="greet">Greet</button>
  </div>
</template>

<script>
export default {
  methods: {
    greet: function(event) {
      // `event` is the native DOM event
      alert(event.target.tagName);
    }
  }
};
</script>
Posted by: Guest on May-26-2020
0

method in vue component

methods: {
  onEnlargeText: function (enlargeAmount) {
    this.postFontSize += enlargeAmount
  }
}
Posted by: Guest on July-08-2021

Browse Popular Code Answers by Language