This commit is contained in:
2026-02-05 10:45:02 +08:00
parent 29baa2f786
commit 42f62d9cd6
6 changed files with 20 additions and 3 deletions

View File

@@ -40,7 +40,7 @@ const router = createRouter({
component: () => import('../views/home/index.vue'),
children: [
{
path: 'test',
path: 'test/:id',
name: 'test',
component: () => import('../views/home/test.vue'),
meta: { topNavStyle: '2' }

View File

@@ -25,7 +25,7 @@
<div class="history-list" v-show="!isCollapse && showHistory">
<div v-for="item in historyList" :key="item.name" class="history-item">
<div v-if="item.title" class="title">{{ item.name }}</div>
<div v-else class="box">
<div v-else class="box" @click="onClickHistoryItem(item)">
<span>{{ item.name }}</span>
<el-popover placement="right" trigger="click">
<template #reference>
@@ -62,9 +62,11 @@
name: $t('Home.today')
},
{
id: 1,
name: 'Conversation Item 1'
},
{
id: 2,
name: 'Conversation Item 2'
},
{
@@ -72,6 +74,7 @@
name: $t('Home.yesterday')
},
{
id: 3,
name: 'Conversation Item 3'
},
{
@@ -79,9 +82,11 @@
name: $t('Home.earlierChat')
},
{
id: 4,
name: 'Conversation Item 4'
},
{
id: 5,
name: 'Conversation Item 5'
}
])
@@ -91,6 +96,10 @@
const onHistory = () => {
showHistory.value = !showHistory.value
}
const onClickHistoryItem = (item: any) => {
console.log(item)
router.push({ name: 'test', params: { id: item.id } })
}
</script>
<style lang="less" scoped>

View File

@@ -1,11 +1,14 @@
<template>
<div class="test">
<p>老八秘制小汉堡</p>
<p>老八秘制小汉堡 - {{ id }}</p>
</div>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'
const route = useRoute()
const id = computed(() => route.params.id)
</script>
<style lang="less" scoped>

View File

@@ -5,6 +5,7 @@
overflow: hidden;
padding: 2.5rem;
display: flex;
user-select: none;
}
.register > .left,
.login > .left {
@@ -35,6 +36,7 @@
.login > .left > .logo > span {
font-weight: 600;
font-size: 3.3rem;
font-family: SemiBold;
}
.register > .right,
.login > .right {

View File

@@ -46,6 +46,7 @@
outline: none;
font-size: 2.2rem;
font-weight: 600;
font-family: SemiBold;
&:active {
opacity: 0.8;
}

View File

@@ -5,6 +5,7 @@
overflow: hidden;
padding: 2.5rem;
display: flex;
user-select: none;
>.left {
flex: 1;
@@ -32,6 +33,7 @@
>span {
font-weight: 600;
font-size: 3.3rem;
font-family: SemiBold;
}
}
}