Skip to content

lkn94/ObjectRenderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

ObjectRenderer

Dynamically convert objects to arrays

Usage (Example for Vue.JS)

import { ObjectHelper } from '@/scripts/parseObject';

ObjectHelper.parseObject(this.technical, this.setTechnical);

setTechnical(value) { this.technicalData = value; }

{{ $t('technical.' + element.key) }} {{ element.value }}

Details

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" ] ]

Use Case

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).

Releases

No releases published

Packages

No packages published