<template>
  <div id="app">
    <div class="y_bj" :style="y_bj"></div>
  </div>
</template>
<script>
import { Toast } from "vant";
export default {
  data() {
    return {
      y_bj: {
        backgroundImage: "url(" + require("@/assets/images/user_bj.png") + ")",
        backgroundRepeat: "no-repeat",
        backgroundSize: "100%",
        width: "100%",   
      }
    };
  },
  methods: {}
};
</script>
<style lang="scss" scoped>
.y_bj {
  width: 375px;
  height: 125px;
}
</style>

vue 背景图片 backgroundImage background-image vue的style方式绑定行内样式-background-image的方式等~

 

如果我的内容对你有帮助,欢迎投食(dashang)。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2021-12-30
  • 2021-08-14
  • 2021-07-06
  • 2021-11-09
  • 2021-11-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2021-10-07
  • 2022-12-23
相关资源
相似解决方案