<template>
	<view>
		<view class="navigation" :style="[{'height': style_setting.height*2+'rpx', 'line-height': style_setting.height*2+'rpx'}, style_setting.bg_show ? {'background-image': 'url('+style_setting.bg_url+')'} : {'background-color': style_setting.bg_color}]">
			<text class="navigation_text" v-for="(item, key) in list" :key="key" v-if="item.title_show" :style="[{'color': item.title_color}, item.title_bg_show ? {'background-image': 'url('+item.title_bg_url+')'} : '']">
			<i v-if="style_setting.title_icon_show" class="navigation_icon" :style="{'background-image': 'url('+item.title_icon_url+')'}"></i>
			<text>{{item.title}}</text>
			</text>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			wrapper_props: {
				type: Object
			}
		},
		data() {
			return {
				style_setting: this.wrapper_props.style_setting,
				list: this.wrapper_props.list
			}
		}
	}
</script>

<style lang="less" scoped>
	.navigation {
		white-space: nowrap;
		overflow: scroll;
		background-repeat: no-repeat;
		background-size: 100% 100%;
		.navigation_text {
			background-size: 100% 100%;
			background-repeat: no-repeat;
			width: 25%;
			text-align: center;
			display: inline-block;
			font-size: 32rpx;
			text {
				vertical-align: middle;
			}
			.navigation_icon {
				display: inline-block;
				width: 32rpx;
				height: 32rpx;
				background-size: 100% 100%;
				background-repeat: no-repeat;
				vertical-align: middle;
				margin-right: 8rpx;
			}
		}
	}
	.navigation::-webkit-scrollbar {
		display: none;
	}
</style>