mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-03 13:44:47 +08:00
fix: 页内菜单带参互相跳转,标签没有选中高亮
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
defineOptions({
|
||||
name: "Menu1-2-2"
|
||||
@@ -8,6 +9,7 @@ defineOptions({
|
||||
|
||||
const input = ref("");
|
||||
const { t } = useI18n();
|
||||
const { query } = useRoute();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -16,5 +18,9 @@ const { t } = useI18n();
|
||||
<p style="text-indent: 2em">{{ t("menus.hsmenu1-2") }}</p>
|
||||
<p style="text-indent: 4em">{{ t("menus.hsmenu1-2-2") }}</p>
|
||||
<el-input v-model="input" />
|
||||
|
||||
<div class="mt-4" v-if="query.text">
|
||||
此页面携带的参数值为:{{ query.text }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -117,6 +117,28 @@ function onCloseTags() {
|
||||
>
|
||||
跳转页内菜单(传path对象)
|
||||
</el-button>
|
||||
|
||||
<el-divider />
|
||||
<el-button
|
||||
@click="
|
||||
$router.push({
|
||||
name: 'Menu1-2-2',
|
||||
query: { text: '传name对象,优先推荐' }
|
||||
})
|
||||
"
|
||||
>
|
||||
携参跳转页内菜单(传name对象,优先推荐)
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="
|
||||
$router.push({
|
||||
path: '/nested/menu1/menu1-2/menu1-2-2',
|
||||
query: { text: '传path对象' }
|
||||
})
|
||||
"
|
||||
>
|
||||
携参跳转页内菜单(传path对象)
|
||||
</el-button>
|
||||
<el-link
|
||||
class="ml-4"
|
||||
href="https://router.vuejs.org/zh/guide/essentials/navigation.html#%E5%AF%BC%E8%88%AA%E5%88%B0%E4%B8%8D%E5%90%8C%E7%9A%84%E4%BD%8D%E7%BD%AE"
|
||||
|
||||
Reference in New Issue
Block a user