I have a component on my parent page like so:
Detail.vue
Template:
<feature-list :description="description"></feature-list>
Script:
axios.get(`my/end/point`)
.then(res => {
this.description = res.data.product.description
})
.catch(function (error) {
console.log('error', error)
})
Features.vue
Template:
<component :is="subcomponent" :height="overallHeight" :width="overallWidth" :length="overallLength"></component>
Script:
components: {
subcomponent: {
props: ['overallHeight', 'overallWidth', 'overallLength'],
/* template: this.description */
}
}
Expected return value from this.description
:
<el-row :gutter="30">
<el-col :sm="24">
<ul class="dimensions d-flex">
<li class="dimension">
<img src="/length.jpg" alt="">
<h4 class="title">Length</h4>
<p class="base-copy">{{length}}</p>
</li>
<li class="dimension">
<img src="/height.jpg" alt="">
<h4 class="title">Height</h4>
<p class="base-copy">{{height}}</p>
</li>
<li class="dimension">
<img src="/width.jpg" alt="">
<h4 class="title">Width</h4>
<p class="base-copy">{{width}}</p>
</li>
</ul>
</el-col>
</el-row>
How can I send the template to the component? and render the values (lenth, width and height)
Something like this, only difference being, the template comes from an ajax call.