这个问题遇到了很多次

 <header class="header" :style="bg">

</header>
<script>
    import {mapActions, mapState, mapGetters} from 'vuex'
    import backGroundImg from '../../assets/img/distribution/分销背景.png';
    export default {
        name: "Distribution",
        data() {
            return {
              backGroundImg,
              bg:{
                background:`url(${backGroundImg})`,
                backgroundSize:'100% 100%'
              }
            }
        },
        methods: {},
        computed: {},
        created() {
        }
    }
</script>

这种还挺好用的

Logo

前往低代码交流专区

更多推荐