As I work on my Vue project, I am facing an issue that needs to be resolved.
https://i.sstatic.net/Emy7o.png
Within my router.js
:
{
path: '/home/aftersale_physicalserver_workpanel/:use_flag/:areapartition_homeshowtext',
meta: { keepAlive: true },
icon: 'compose',
name: 'aftersale_physicalserver_workpanel',
title: 'work panel',
component: resolve => {
require(['./views/main_home/home/components/general_admin_staff_panel/physicalserver/physicalserver_workpanel.vue'], resolve);
}
},
In the code snippet above, you can see:
...
<template>
<lml-page
ref="lml_page_ref"
v-if=" origin_data && origin_data.count"
:data_count="origin_data.count"
:current.sync="cur_page"
@change_page_for_parent="server_change_page">
</lml-page>
</template>
...
<script>
export default {
props: {
...
cur_page: 1,
},
</script>
The value of cur_page
indicates the page number. My goal is to append this page number to the URL so that when I navigate back from a detail page, it remembers the correct page.
Objective
My objective is to ensure that the list page retains certain parameters, such as the previous page number and search criteria. However, I am unsure how to achieve this in Vue.js.
For instance, when I move from a searched parameter page to a detailed page and then return using:
<span class="go-left" @click="$router.go(-1)">
<Icon type="chevron-left"></Icon>
<span>Go back</span>
</span>
The list page does not display the previously searched data.