解决uni-app设置背景图片不显示、挤组件

1,711 阅读1分钟

设置动态加载图片即可解决-可能是唯一方法

<template>
 <view class="index" :style={backgroundImage:`url(${indexBackgroundImage})`,backgroundSize: 'cover'}">
        <!--你的内容-->
    </view>
</template>

<script>

    
    import indexBackgroundImage from "@/static/img/account_index.jpg"

    export default {

        data() {

            return {
                indexBackgroundImage:indexBackgroundImage

            }

        },

        methods: {      

        }

    }

</script>

<style lang="scss" scoped="">

</style>