• 代码块
<template>
  <div class="app-container" :style="backgroundDiv" />
</template>

<script>
export default {
  data() {
    return {
      // 背景图片
      backgroundDiv: {
        backgroundImage: 'url(' + require('@/assets/image/a.jpg') + ')',
        backgroundRepeat: 'no-repeat',
        backgroundSize: '100% 100%'
      }
    }
  }
}
</script>

<style>
 .app-container{
    height: 100%;
    width:100%;
  }
</style>
  • app-container 定义class属性,决定宽高
  • backgroundDiv 图片属性
Logo

前往低代码交流专区

更多推荐