Is there a way to pass component data in <router-link to="...">
? Here's an example:
var data = { files: [{ name: "test", path: "/test" }] };
var component = {
data: function() {
return data;
},
template: '<ul class="files"><li v-for="file in files"><router-link to="{{ file.path }}">{{ file.name }}</router-link></li></ul>',
created: function() {...}
};
In the above code snippet, the output is
<li><a href="#/{{ file.path }} ">test</a></li>
. How can I display /test
instead of #/{{ file.path }}
?