<template>
  <view>
    <u-sticky :h5NavHeight="h5NavHeightP">
      <view class="px-26rpx">
        <u-subsection
          :list="list"
          ::current="current"
          @change="handleChangeSub"
        ></u-subsection>
      </view>
    </u-sticky>
    <PestsChart v-if="current == 0"></PestsChart>
    <PestsImage v-if="current == 1"></PestsImage>
  </view>
</template>
<script>
import PestsChart from './components/pests-chart.vue'
import PestsImage from './components/pests-images.vue'
export default {
  components: {
    PestsChart,
    PestsImage,
  },
  data() {
    return {
      list: [
        {
          name: '虫情统计',
        },
        {
          name: '虫情图片',
        },
      ],
      current: 0,
    }
  },
  methods: {
    handleChangeSub(e) {
      this.current = e
    },
  },
}
</script>
