Vue.js data-bind style backgroundImage not working

后端 未结 9 1304
耶瑟儿~
耶瑟儿~ 2020-12-12 16:18

I\'m trying to bind the src of an image in an element, but it doesn\'t seem to work. I\'m getting an \"Invalid expression. Generated function body: { backgroundImage:{ url(

9条回答
  •  轮回少年
    2020-12-12 16:45

    The accepted answer didn't seem to solve the problem for me, but this did

    Ensure your backgroundImage declarations are wrapped in url( and quotes so the style works correctly, no matter the file name.

    ES2015 Style:

    Or without ES2015:

    Source: vuejs/vue-loader issue #646

提交回复
热议问题