| 12345678910111213141516171819202122232425262728293031 |
- <template>
- <view class="index_container">
- <view class="segmented_control_container">
- <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text"
- activeColor="#409eff"></uni-segmented-control>
- </view>
- <view class="content">
- <view id="all" v-show="current === 0">待办</view>
- <view id="readed" v-show="current === 1">在办</view>
- <view id="unread" v-show="current === 2">办结</view>
- <view id="unread" v-show="current === 3">我的</view>
- </view>
- </view>
- </template>
- <script setup lang="ts">
- import { reactive, ref } from 'vue';
- const items = reactive(['待办', '在办', '办结', '我的'])
- const current = ref(0)
- function onClickItem(e) {
- if (current != e.currentIndex) {
- current.value = e.currentIndex;
- }
- }
- </script>
- <style lang="scss">
- .segmented_control_container {
- margin-top: 10px;
- }
- </style>
|