A simple and efficient way to achieve this is by utilizing string interpolation with template literals. I suggest organizing all the necessary logic into a computed property, which improves the clarity of your template:
<div :style="styleObject"></div>
As shown below in the computed property example, it's advised to add 'px' to length properties to prevent errors when values are non-zero (provided you want them as pixel values):
computed: {
styleObject() {
return {
boxShadow: `${this.x_axis}px ${this.y_axis}px ${this.blur}px ${this.spread}px ${this.color}`
};
}
}
Furthermore, you can format it multiline for better readability using template literals that support line breaks:
computed: {
styleObject() {
return {
boxShadow: `${this.x_axis}px
${this.y_axis}px
${this.blur}px
${this.spread}px
${this.color}`
};
}
}