Subscribe on changes!

Can't use v-bind in css in background-image: url();

avatar
Apr 15th 2022

Version

3.2.31

Reproduction link

sfc.vuejs.org/

Steps to reproduce

use v-bind in css in background-image: url(); but both the local src and the remote src will report an error.

What is expected?

can use v-bind in css in background-image

What is actually happening?

Syntax Error: ModuleNotFoundError: Module not found: Error: Can't resolve './var(--c9asdsad-src' in 'E:\Code\xxx'

avatar
Apr 15th 2022

should be

const remoteSrc = 'url(https://cdn4.buysellads.net/uu/1/41334/1550855401-cc_light.png)'

see sfc

https://www.w3.org/TR/css-variables-1/#syntax

avatar
Apr 15th 2022

oh, it's my problem. Thanks for your reply.