navigation.vue 1.82 KB
Newer Older
王建威's avatar
王建威 committed
1
<template>
王建威's avatar
王建威 committed
2
	<view class="navigation" :style="[{'height': style_setting.height*2+'rpx', 'height': style_setting.height*2+'rpx'}, style_setting.bg_show ? {'background-image': 'url('+style_setting.bg_url+')'} : null, {'background-color': style_setting.bg_color}]">
王建威's avatar
王建威 committed
3 4 5
		<view>
			<text class="navigation_item" v-for="(item, key) in list" :key="key" v-if="item.title_show">
				<text class="navigation_text" :style="[{'color': item.title_color}, item.title_bg_show ? {'background-image': 'url('+item.title_bg_url+')'} : '']" @click="$jump(item.link)">
王建威's avatar
王建威 committed
6
				<i v-if="item.title_icon_show" class="navigation_icon" :style="{'background-image': 'url('+item.title_icon_url+')'}"></i>
王建威's avatar
王建威 committed
7 8
				<text>{{item.title}}</text>
				</text>
王建威's avatar
王建威 committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
			</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 {
王建威's avatar
王建威 committed
32 33
		display: flex;
		align-items: center;
王建威's avatar
王建威 committed
34 35 36 37
		white-space: nowrap;
		overflow: scroll;
		background-repeat: no-repeat;
		background-size: 100% 100%;
王建威's avatar
王建威 committed
38 39
		padding: 0 24rpx;
		box-sizing: border-box;
王建威's avatar
王建威 committed
40
		border-right: 10rpx solid rgba(0,0,0,0.4);
王建威's avatar
王建威 committed
41 42 43 44 45
		.navigation_item {
			width: 177.5rpx;
			display: inline-block;
			text-align: center;
		}
王建威's avatar
王建威 committed
46 47 48
		.navigation_text {
			background-size: 100% 100%;
			background-repeat: no-repeat;
王建威's avatar
王建威 committed
49 50
			min-width: 120rpx;
			height: 48rpx;
王建威's avatar
王建威 committed
51 52
			text-align: center;
			display: inline-block;
王建威's avatar
王建威 committed
53
			font-size: 28rpx;
王建威's avatar
王建威 committed
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
			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>