I my pages component i loop through. The problem is that the loop ommits for example <div class="wp-block-columns"> with <div><div class="wp-block-columns"></div>
Is there a way that i can loop and do this <div v-if="item.substring(0,10) !== 'component-'" v-html="item"></div> without outputting the div around the other?
How can achieve that?
Pages component:
<template v-for="item in json.content">
<component v-if="item.substring(0,10) === 'component-'" :is="item"></component>
<div v-if="item.substring(0,10) !== 'component-'" v-html="item"></div>
</template>
Data php array which will be converted to json:
array:13 [▼
1 => "<div class="wp-block-columns">"
2 => "<div class="wp-block-column col-md-6" style="flex-basis:33.38%">"
3 => "<p>111</p>"
4 => "</div>"
8 => "<div class="wp-block-column col-md-6" style="flex-basis:33.63%">"
9 => "<p>222</p>"
10 => "</div>"
14 => "<div class="wp-block-column col-md-6" style="flex-basis:33%">"
15 => "<p>333</p>"
16 => "</div>"
17 => "</div>"
20 => "component-adreswidget"
23 => "<p>test</p>"
]