项目初始化
This commit is contained in:
@@ -73,8 +73,9 @@ const switchTabByRoute = (item) => {
|
||||
router.push({
|
||||
path: item.path,
|
||||
query: {
|
||||
year: queryDate.value,
|
||||
...route.query
|
||||
...route.query,
|
||||
yearDate: queryDate.value,
|
||||
|
||||
}
|
||||
}).catch(err => {
|
||||
ElMessage.error('页面切换失败,请重试');
|
||||
@@ -90,7 +91,7 @@ const handleQuery = () => {
|
||||
path: route.path,
|
||||
query: {
|
||||
...route.query,
|
||||
year: queryDate.value
|
||||
yearDate: queryDate.value,
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -112,8 +113,8 @@ async function getList() {
|
||||
onMounted(() => {
|
||||
getList();
|
||||
router.afterEach((to) => {
|
||||
if (to.query.year) {
|
||||
queryDate.value = to.query.year;
|
||||
if (to.query.yearDate) {
|
||||
queryDate.value = to.query.yearDate;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user