Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-05-15 21:29:29 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9ea2c4f80e6cf5cf8672d3b1bc256e9b5921ca36
9ea2c4f8
1 parent
f60cda4b
fix
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
22 deletions
src/views/client/bookDetail.vue
src/views/client/chooseSchool.vue
src/views/client/bookDetail.vue
View file @
9ea2c4f
...
...
@@ -342,7 +342,7 @@ onBeforeRouteLeave((to, from) => {
} else {
changeRouterKeepAlive(from.path, false);
// BUG: 改变keepAlive数据不刷新,只能手动刷新
if (to.path
!== '/client/chooseSchool' && to.path !== '/me/index
') {
if (to.path
=== '/client/chooseBook
') {
location.reload()
}
}
...
...
src/views/client/chooseSchool.vue
View file @
9ea2c4f
...
...
@@ -19,25 +19,6 @@ import { Toast } from 'vant';
const $router = useRouter();
// 幼儿园列表页
const schoolList = ref([])
axios.get('/srv/?a=kg_list')
.then(res => {
if (res.data.code === 1) {
schoolList.value = res.data.data;
} else {
console.warn(res);
if (!res.data.show) return false;
Toast({
icon: 'close',
message: res.data.msg
});
}
})
.catch(err => {
console.error(err);
})
// 跳转幼儿园爱心书籍列表页
const onClick = (item) => {
$router.push({
...
...
@@ -47,16 +28,37 @@ const onClick = (item) => {
}
});
}
</script>
<script>
import mixin from 'common/mixin'
import { mainStore } from '@/store'
import { storeToRefs } from 'pinia'
export default {
beforeRouteEnter (to, from, next) {
// 幼儿园列表页
axios.get('/srv/?a=kg_list')
.then(res => {
if (res.data.code === 1) {
to.params.schoolList = res.data.data;
next();
} else {
console.warn(res);
if (!res.data.show) return false;
Toast({
icon: 'close',
message: res.data.msg
});
}
})
.catch(err => {
console.error(err);
})
},
mixins: [mixin.init],
data () {
return {
schoolList: this.$route.params.schoolList
}
},
mounted () {
...
...
Please
register
or
login
to post a comment