How to inject component data in <router-link to="...">
? Sample:
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 this sample the output is <li><a href="#/{{ file.path }} ">test</a></li>
. How do I get /test
instead of #/{{ file.path }}
?