title: Reusable component to render button or router-link in Vue.js
body: <p>I'm new using Vue.js and I had a difficulty creating a <code>Button</code> component.</p>
  
  <p>How can I program this component to conditional rendering? In other words, maybe it should be rendering as a <code>router-link</code> maybe as a <code>button</code>? Like that:</p>
  
  <pre><code>&lt;Button type="button" @click="alert('hi!')"&gt;It's a button.&lt;/Button&gt;
  // -&gt; Should return as a &lt;button&gt;.
  
  &lt;Button :to="{ name: 'SomeRoute' }"&gt;It's a link.&lt;/Button&gt;
  // -&gt; Should return as a &lt;router-link&gt;.
  </code></pre>