result = home .map(function(item) {
return item.homeName;
})
result = home.find(function(item) {
return item._id === id
}) || -1;
У меня так:
...
{path: '/templates', component: require('./components/Templates.vue')},
{path: '/templates/:id',
component: require('./components/Template.vue'),
props: true
},
...
export default {
name: 'template',
data: function () {
return {
///
};
},
props: [
'id'
],
watch: {
id: function() {
this.loadTemplate();
}
},
mounted: function () {
this.loadTemplate();
},
methods: {
...
Time: 12245ms
Asset Size Chunks Chunk Names
app.build.js 50.4 kB 0 [emitted] app
vendor.build.js 546 kB 1 [emitted] [big] vendor
style.css 53 kB 0, 1 [emitted] app, vendor
style.css.map 86 bytes 0, 1 [emitted] app, vendor