图片文字居中显示(Picture text centered)

<template>
	<view class="content">
		<view class="banner">
			<image :src="banner" mode="widthFix" class="banner_img"></image>
			<view class="banner_img_text">LV</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				    banner:"/",
			}
		},
		methods: {
			
		}
	}
</script>

<style lang="scss">
	.banner{
		display:flex;
		align-items: center;//子元素垂直居中
		justify-content: center;//子元素水平居中
	}
	.banner_img{
		width: 100%;
	}
	.banner_img_text{
		color: #FFF;
		z-index: 1;
		text-align: center;
		position: absolute;
	}

</style>
    
————————
<template>
	<view class="content">
		<view class="banner">
			<image :src="banner" mode="widthFix" class="banner_img"></image>
			<view class="banner_img_text">LV</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				    banner:"/",
			}
		},
		methods: {
			
		}
	}
</script>

<style lang="scss">
	.banner{
		display:flex;
		align-items: center;//子元素垂直居中
		justify-content: center;//子元素水平居中
	}
	.banner_img{
		width: 100%;
	}
	.banner_img_text{
		color: #FFF;
		z-index: 1;
		text-align: center;
		position: absolute;
	}

</style>