//my-tabbar文件
<template>
	<view>
		<u-tabbar :value="currentTab" :fixed="true" :border="false" activeColor="#d81e06" :placeholder="false"
			@change="changeTabIndex">
			<u-tabbar-item v-for="item in switchTabs" :key="item.name" :text="item.text"
				:icon="item.iconName"></u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				switchTabs: [{
						"pagePath": "/pages/index/index",
						"iconName": "home",
						"text": "首页",
						"name": "index"
					},
					{
						"pagePath": "/pages/my/my",
						"iconName": "account",
						"text": "我的",
						"name": "my"
					}
				]
			}
		},
		props: ['currentTab'],
		methods: {
			changeTabIndex(e) {
				let pagePath = this.switchTabs[e].pagePath
				uni.switchTab({
					url: pagePath
				})
			}
		}
	}
</script>