force reload data when hash is not changed

This commit is contained in:
LiYang 2016-07-31 16:35:23 +08:00
parent fd9f740e76
commit 70aa8fff75
3 changed files with 10 additions and 15 deletions

View File

@ -128,7 +128,7 @@
method: "PUT",
data: data,
success: (data)=> {
// todo
alert("更新成功");
}
})
}

View File

@ -67,9 +67,11 @@
data(){
this.$watch('showAdminOnly', function (val) {
sessionStorage.showAdminOnly = JSON.stringify(val);
this.$router.go({name: this.$route.name, params: {page: 1}});
this.$router.go({path: "/user/1", query: {_: (new Date()).getTime()}});
});
this.pagination.currentPage = this.$route.params.page;
if (sessionStorage.showAdminOnly) {
this.showAdminOnly = JSON.parse(sessionStorage.showAdminOnly);
}
@ -99,8 +101,9 @@
},
search() {
sessionStorage.userListSearchKeyword = this.keyword;
this.pagination.currentPage = 1;
this.loadData();
this.$router.go({path: "/user/1", query: {_: (new Date()).getTime()}});
// pager goto page 1
// url -> /user/1
},
edit(userId) {
this.$router.go("/user/edit/" + userId)

View File

@ -1,17 +1,9 @@
<template id="back">
<nav>
<nav onclick="history.back()">
<ul class="pager">
<li class="previous">
<a href="#" v-link="url">
<span aria-hidden="true">&larr;</span>
{{ $t("adminUtils.back") }}
</a>
<span aria-hidden="true">&larr; {{ $t("adminUtils.back") }}</span>
</li>
</ul>
</nav>
</template>
<script>
export default{
props: ["url"]
}
</script>
</template>