Vue 1.x/2.x: Get vue-router path url from a $route object
<p>As we know, we can use <code>vue-route</code> to wrap some route paths.</p>

<pre><code>&lt;!-- vue 1.x --&gt;
&lt;a v-link="{name: 'route_name', params: {id: 1}}"&gt;&lt;/a&gt;
</code></pre>

<p>And in vue2:</p>

<pre><code>&lt;!-- vue 2.x --&gt;
&lt;router-link :to="{name: 'route_name', params: {id: 1}}"&gt;&lt;/router-link&gt;
</code></pre>

<p>And now, I want to display a link url for the user to copy, so I wonder if there is a way to return the absolute path url from a route object? It seemed the docs did not mention that.</p>

<p>For example, I want:</p>

<pre><code>&lt;template&gt;
  &lt;label&gt;Copy the address&lt;/label&gt;
  &lt;input value="url" /&gt;
&lt;/template&gt;

&lt;script&gt;
  export default {
    computed: {
      url() {
        const route = {name: 'route_name', params: {id: 1}};
        // !! The bellow shows what I may want.
        return this.$router.getLink(route);
      },
    }.
  };
&lt;/script&gt;
</code></pre>

<p>Is there such a method?</p>