title: Use current vue component's method as default prop value
body: <p>I am going to pass function as property to Vue component. Let it be function has to be invoked by <code>@click</code>. But for some reasons I want to keep default behaviour for the component. The default behaviour is not so easy as I want and I'm going to use <code>method</code> as default function. Because the default behaviour requires data from component's state (props, data, other methods, whatever).</p>
  
  <p>Is there a way to do? </p>
  
  <p>I've attached the example. Expected behaviour:</p>
  
  <p>Button <code>works fine</code> should produce alert <code>You are welcome!</code><br>
  Button <code>nope</code> should produce alert <code>You are welcome as well!</code> but does nothing.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>Vue.component('welcome-component', {
    template: '#welcome-component',
    props: {
      name: {
        type: String,
        required: true,
      },
      action: {
        type: Function,
        required: false,
        default: () =&gt; { this.innerMethod() },
      },
    },
    methods: {
      innerMethod() {
        alert("You are welcome as well!");
      }
    }
  });
  
  
  var app = new Vue({
    el: "#app",
    methods: {
      externalMethod() {
        alert("You are welcome!");
      }
    }
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#app {
    margin: 20px;
  }
  
  .holder &gt; button {
    margin: 10px;
    padding: 5px;
    font-size: 1.1em;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"&gt;&lt;/script&gt;
  &lt;div id="app"&gt;
    &lt;welcome-component name="works fine" :action="externalMethod"&gt;&lt;/welcome-component&gt;
    &lt;welcome-component name="nope"&gt;&lt;/welcome-component&gt;
  &lt;/div&gt;
  
  
  &lt;script id='welcome-component' type='x-template'&gt;
    &lt;div class="holder"&gt;
      &lt;button @click="action"&gt;{{ name }}&lt;/button&gt;
    &lt;/div&gt;
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>