Currently, I am facing a scenario where I need to create computed local subcomponents. Specifically, I am working on custom data grid row cell components. Here is an example of what I am trying to achieve:
var DataGridRow = {
props: ['columns'],
template: '<tr><component v-for="col in columns" :is="col.component"></component></tr>',
components: function () {
var comps = {};
// Custom logic to dynamically build subcomponents here
return comps;
}
}
I have encountered issues when attempting this in my tests.
Could it be that this functionality exists but is undocumented, or am I approaching it incorrectly?
If not, would it be feasible to implement such a feature?
Alternatively, is there a better solution that does not involve declaring global components?
EDIT: Further discussion can be found here: https://github.com/vuejs/vue/issues/4651