Files: fix accessed_at.
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user