I'm working with VueJS library to generate form from a JSON schema, the library work great beside one issue, if I'm loading the JSON directly from the data() I can see the form content perfectly: https://codepen.io/eran-levi/pen/wvGVBGJ
(here is the Schema JSON inside data()):
schema: {
type: 'object',
properties: {
stringProp: {
type: 'string',
title: 'I\'m a string',
description: 'This description is used as a help message.'
}
}
}
But, once I'm trying to load it dynamically (I'm loading the data and only then update it), in this case I cant see anything on page, see it here: https://codepen.io/eran-levi/pen/WNwVbGZ
(Here is how I'm trying to update the field):
created() {
setTimeout(function(){
console.log('Component has been created!');
this.schema.properties.stringProp = {
type: 'string',
title: 'I\'m a string',
description: 'This description is used as a help message.',
}
}, 3000);
}
Can you please explain why I can not update the field dynamically and see it right away?
Thank you!
setTimeout(() => {...}, }instead offunction () {}