setting.vue 707 B

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <fs-container>
  3. <template #default>
  4. <fs-cell-group arrow border gutter>
  5. <fs-cell link="/pages/my/userInfo" title="个人信息"></fs-cell>
  6. </fs-cell-group>
  7. </template>
  8. <template #footer v-if="token">
  9. <view class="layout-box">
  10. <fs-button round full @click="handleLogout">退出登录</fs-button>
  11. </view>
  12. </template>
  13. </fs-container>
  14. </template>
  15. <script setup>
  16. import { computed } from 'vue'
  17. import { useStore } from 'vuex'
  18. import useUser from '@/hooks/useUser'
  19. const store = useStore()
  20. const token = computed(() => store.state.token)
  21. const handleLogout = () => {
  22. store.dispatch('logout').then(res => {
  23. console.log('logout')
  24. })
  25. }
  26. </script>
  27. <style>
  28. </style>