feat: 右上角图标随个人中心弹窗展示而变化

This commit is contained in:
2025-12-24 11:48:31 +08:00
parent a5cf919ded
commit 53b9a83b80
6 changed files with 65 additions and 8 deletions

View File

@@ -1,13 +1,23 @@
<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import MyEvent from '@/utils/myEvent'
const router = useRouter()
defineProps({
title: { type: String, default: 'STYLING ASSISTANT' }
title: { type: String, default: 'STYLING ASSISTANT' },
})
const emit = defineEmits(['clickReturn', 'clickProfile'])
const profileVisible = ref(false)
const handleProfileVisibleChange = (visible) => {
profileVisible.value = visible
}
MyEvent.add('change-profile-visible',handleProfileVisibleChange)
const handleClickReturn = () => {
router.back()
// emit('clickReturn')
@@ -22,7 +32,9 @@
<div class="header-title">
<div class="return" @click="handleClickReturn"><SvgIcon name="return" size="34" /></div>
<span class="title">{{ title }}</span>
<div class="profile" @click="handleClickProfile"><SvgIcon name="profile" size="45" /></div>
<div class="profile" @click="handleClickProfile">
<SvgIcon :name="profileVisible ? 'profileFilledBlack' : 'profile_white'" size="45" />
</div>
</div>
</template>