uni-app在手機上背景圖片不顯示

uni-app解決無法加載本地圖片的方法【動態加載背景圖片*唯一的解決辦法】

特別注意:千萬別忘記了【`url(${indexBackgroundImage})`】

<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>

轉自:https://blog.csdn.net/weixin_43343144/article/details/90300788

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章