properties: {
somevar: {
type: String,
readOnly: true
},
...<somecomponent somevar="<?= $datasource['somevar'] ?>"></somecomponent><div class$="{{somevar}}"></div><div class="style-scope somecomponent"></div>Setting the property as readonly means you cannot assign a value to it using the declarative markup in your page. This has the effect that the component discards the value you set in the attribute in the html.
Normally you would set the value statically in the property definition in your component when defining the property as readonly. To be able to assign a value to the property from outside the component via html markup then you need to remove the readonly setting.
--