Is it possible to print something inside a Function (forEach)? Vue.Js, JavaScript

M

Muhaddis

Guest
I am working on Vuetify form generator and I want to print the generated code in the proper format.

Is it possible to print something inside a forEach function?

GiveMeCode() {
this.Dialog = true
this.SourceCode =
`<template>
<v-form ref="Form">
<v-container class="text-center">` +
+`</v-container>
</v-form>
</template>
`
}


Something like:(which actually returns undefined)

GiveMeCode() {
this.Dialog = true
this.SourceCode =
`<template>
<v-form ref="Form">
<v-container class="text-center">` +
this.Fields.forEach(Field => {"ITERATE & PRINT SOMETHING HERE & USE DATA PROPERTIES"})
+`</v-container>
</v-form>
</template>
`
}


I want to use forEach loop to iterate the code. If that's not the best way what another way should I use to iterate the loop and print the output accordingly.

This is how my code syntax highliter look like. I am using Vue & Vuetfiy. <PrismEditor readonly :code="SourceCode" language="vue"></PrismEditor><v-card-text>

Any help would be much appreciated

Continue reading...
 
Top