<template>
  <tm-app>
    <tm-sheet>
      <tm-text label="点击中间+按钮可以体验异步加载动态效果."></tm-text>
    </tm-sheet>
    <tm-tabbar :autoSelect="false" v-model:active="acc">
      <tm-tabbar-item
          @click="acc = 0"
          activeColor="orange"
          count="HOT"
          open-type="reLaunch"
          text="选票"
          icon="tmicon-collection-fill"
      ></tm-tabbar-item>
      <tm-tabbar-item @click="acc = 1" activeColor="orange" text="我的" icon="tmicon-cog-fill"></tm-tabbar-item>
    </tm-tabbar>
  </tm-app>
</template>
<script  setup>
import {ref, getCurrentInstance, defineProps, defineEmits, watch,} from 'vue'
import { onShow, onLoad } from '@dcloudio/uni-app'
import tmApp from '@/tmui/components/tm-app/tm-app.vue'
import tmSheet from '@/tmui/components/tm-sheet/tm-sheet.vue'
import tmText from '@/tmui/components/tm-text/tm-text.vue'
import tmTabbar from '@/tmui/components/tm-tabbar/tm-tabbar.vue'
import tmTabbarItem from '@/tmui/components/tm-tabbar-item/tm-tabbar-item.vue'
const emit=defineEmits(['update:modelValue'])
const acc = ref(1)
watch(acc,()=>{
  emit('update:modelValue',acc.value)
})
function laodingfun(val) {
  return new Promise((res) => {
    setTimeout(function () {
      console.log('选中了：', val)
      res(true)
    }, 2000)
  })
}
</script>
