Inline style in vue dynamically writes background-image

     :style="background-image:url(+img where url is written in data is

      img: require("@/assets/img/nodata1.png")

The point to note is to use require instead of url, which will not take effect

Guess you like

Origin blog.csdn.net/weixin_43703816/article/details/131472283