Files: fix accessed_at.

This commit is contained in:
chiayin
2023-04-27 11:16:33 +08:00
parent cbde7b2d4c
commit b1161a82a7
10 changed files with 186 additions and 21 deletions

View File

@@ -31,12 +31,27 @@ export default {
return { checkLogin, loadingStore, temporaryData, tempFilterId, postRuleData };
},
watch: {
$route: function(route) {
if(route.name !== 'Discover') {
$route: function(to, from) {
if(to.name !== 'Discover') {
this.tempFilterId = null;
this.temporaryData = []
this.postRuleData = []
}
// console.log(to, from);
// if(to.name === 'Discover'){
// this.$swal({
// title: '請問是否要離開頁面?',
// showCancelButton: true,
// confirmButtonText: '是',
// cancelButtonText: '否',
// }).then((result) => {
// if (result.isConfirmed) {
// window.history.back() // 或 window.close()
// } else {
// console.log('no')
// }
// })
// }
}
},
components: {
@@ -55,5 +70,28 @@ export default {
*/
this.checkLogin();
},
beforeRouteUpdate(to, from, next) {
if (from.name === 'Discover') {
this.$swal({
title: '請問是否要離開頁面?',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: '是',
cancelButtonText: '否',
}).then((result) => {
if (result.isConfirmed) {
console.log('yes')
next()
} else {
console.log('no')
next(false)
}
})
} else {
next()
}
},
};
</script>