Why template $setState {{}} don't work inside style of a div

I’ve this code:

  <div style="background-image:url('{{urlserver}}img.php?obj_id={{id}}')" class="card-header align-items-flex-end">{{title}}</div>
  <div class="card-content card-content-padding">
    <p class="date">{{date}} - {{date_end}}</p>
    <p>testing:  --- {{urlserver}} --- {{id}}</p>

I want to create the url of the background image with $setState and {{urlserver}} …
But inside:
it doesn’t work… don’t put the url and id…
despite under, in:
<p>testing: --- {{urlserver}} --- {{id}}</p>
it put the urlserver and id…
but not inside the style of the image…

Thanks for your answer

I’ve does it by javascript code, in this way:

var backImageUrl = "url('"+ window.serverUrl+ "img.php?obj_id=" + varObj_id + "')";

document.getElementById('topCard').style.backgroundImage = backImageUrl;

anyway I dont know why $setState don’t work in the way I used in the previous message