I'm trying to bind a computed function to my style. And in this computed function I'm using a property. But Vue gives me the error that it expects an object but gets a function. This is my code.
<template>
<div id="banner" :style="extractImageURL">
</div>
</template>
<script>
export default {
props: ['imageURL'],
computed(){
extractImageURL()
{
return "background-image: url(" + this.imageURL + ");"
}
}
}
</script>
this format:
computed:{
extractImageURL: function()
{
return "background-image: url(" + this.imageURL + ");"
}
}