0

I have some SCSS which works fine when making a CSS file

.title {
  background-image:linear-gradient(
    to right bottom,
    rgba($color-primary-light, 0.6), $color-primary-dark), 
    url(../imgs/img.jpg);
}

What I would like to do is dynamically pass the image to the CSS when rendered, based from an image gotten when mounted

<section class="title" :style="{ 'background-image': 'blog.coverImage' }">
biberman
  • 5,606
  • 4
  • 11
  • 35
user5067291
  • 440
  • 1
  • 6
  • 16
  • You can pass it as an inline style background image. – Cameron Jun 16 '20 at 14:46
  • What is the issue here? What is the `blog.coverImage` here? Could you please create a [small demo](https://stackoverflow.com/help/minimal-reproducible-example) for this using [codesandbox.io](https://codesandbox.io/s/vue) to show the issue happening? – palaѕн Jun 16 '20 at 14:47
  • The codebox is pretty much the code above, but here you go. https://codesandbox.io/s/modest-pond-9jc1p?file=/src/components/HelloWorld.vue – user5067291 Jun 16 '20 at 14:56

0 Answers0