Dynamically convert objects to arrays
import { ObjectHelper } from '@/scripts/parseObject';
ObjectHelper.parseObject(this.technical, this.setTechnical);
setTechnical(value) { this.technicalData = value; }
{{ $t('technical.' + element.key) }} {{ element.value }}The method parseObjects expects an object as first input. Second input is a callback function. The callback function sets the variables into the vue file in scripts part. parseObject works with Promises.
The result is an multidimensional array. Each array contains the key and value: [ 0: [ "key": "ObjectKeyName", "value": "ObjectKeyValue" ] ]
If you want to render an object in your frontend code you can add new attributes to your object server side and render them into your frontend without the need to recompile. E. g. you can display dynamic lists in your VueJS-Frontend. Example: Smarthome Kompendium (Technical data part of the component on this website).