Answer the question
In order to leave comments, you need to log in
How to insert a background image in PUG + NUXT?
I'm using nuxt (ssr in vue), I need to insert the image inline:
div.uk-section-media(style='background-image: url(~assets/img/logo.png)') //Не работает
img.logo(src='~assets/img/logo.png', alt='Nuxt.js Logo') //Работает
Answer the question
In order to leave comments, you need to log in
:style="{'background-image': 'url(' + require('~/assets/img/logo.png') + ')' }"
This
In a simple template engine, it would look like this, that is, bind to an attribute, and characters are concatenated in brackets.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question