[Vuejs]-Vue – Binding data in css with braces syntax

2👍

You can’t put vue bind in styles.

if you want to tag’s background-image, try in vue component like this

<script>
export default {
    mounted: function () {
      document.body.style.backgroundImage = `url("${this.album.images[0].url}")`;
    },
    data() {
        return {...}
    }
}
</script>

or if you want change background when album.images changed, just put code on watch property

Leave a comment