feat:增加设置模块
This commit is contained in:
@@ -6,10 +6,17 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from 'vue-router'
|
||||
import { isMobile } from 'vue3-common/utils/layoutUtil'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const loginClick = () => {
|
||||
if (!isMobile()) {
|
||||
ElMessage.error('暂不支持PC端')
|
||||
return
|
||||
}
|
||||
|
||||
router.push('/record')
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,12 +1,37 @@
|
||||
<template>
|
||||
<div class="common-mobile-view profile">
|
||||
个人中心
|
||||
<div>
|
||||
<span>版本号:</span>
|
||||
<span>{{ appStore.version }}</span>
|
||||
</div>
|
||||
<div class="button-container">
|
||||
<el-button type="primary" @click="viewLatestVersionClick">检查新版本</el-button>
|
||||
<el-button type="primary" @click="logoutClick">退出登录</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useAppStore } from '@/store/app.ts'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const appStore = useAppStore()
|
||||
const router = useRouter()
|
||||
|
||||
const viewLatestVersionClick = () => {
|
||||
location.reload()
|
||||
}
|
||||
|
||||
const logoutClick = () => {
|
||||
router.push('/')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
<style lang="scss">
|
||||
.profile {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -38,7 +38,7 @@ import FoodTimeline from '@/components/Food/FoodTimeline.vue'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { onMounted, reactive } from 'vue'
|
||||
import { useFoodStore } from '@/store/food'
|
||||
import { IFoodSegment } from '@/types/food'
|
||||
import type { IFoodSegment } from '@/types/food'
|
||||
|
||||
const foodStore = useFoodStore()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user