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

0👍

I assume GiveMeCode() is a computed property? It seems kind of odd to put that much markup into a computed property.

You should have your markup already in your template. You can show/hide it via v-if/v-show if you need to.

Regarding your list of fields I think you have 2 options depending on what your data is (hard to tell without more context).

You can iterate over your items via v-for and spit out whatever you need. The other option would be to create a custom filter. Filters allow you to neatly extract your formatting code into it’s own function.

Leave a comment