<template>
  <view>
    <u-tabbar :value="current ? current : 0" @change="tabbarChange" :fixed="true" :placeholder="false"
      :safeAreaInsetBottom="true" activeColor="#dd524d">
      <u-tabbar-item text="首页" icon="../../static/index.svg"></u-tabbar-item>
      <u-tabbar-item text="日程" icon="../../static/todo.svg"></u-tabbar-item>
      <u-tabbar-item text="鱼塘" icon="../../static/pool.svg"></u-tabbar-item>
      <u-tabbar-item text="我的" icon="../../static/mine.svg"></u-tabbar-item>
    </u-tabbar>
  </view>
</template>

<script>
export default {
  props: {
    current: Number
  },
  data() {
    return {
      list: [
        { path: "pages/index/index" },
        { path: "pages/cart/cart" },
        { path: 'pages/category/category' },
        { path: "pages/center/center" }]
    };
  },
  methods: {
    tabbarChange(e) {
      uni.switchTab({
        url: '/' + this.list[e].path
      })
    }
  }
}
</script>

<style lang="scss"></style>
