| | |
| | | <template> |
| | | <div id="app"> |
| | | <div |
| | | id="app" |
| | | |
| | | > |
| | | <router-view /> |
| | | </div> |
| | | </template> |
| | |
| | | return {}; |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | beforeDestroy() {}, |
| | | mounted () { |
| | | window.addEventListener('beforeunload', e => { |
| | | sessionStorage.setItem('beforeunload', 1); |
| | | }); |
| | | |
| | | // 监听页面刷新 |
| | | if (sessionStorage.getItem('beforeunload') == 1) { |
| | | let name = sessionStorage.getItem("routerName"); |
| | | |
| | | if (name) { |
| | | this.$nextTick(function () { |
| | | this.$router.push({ path: name }); //如果sessionStorage存在路由,去缓存的路由 |
| | | }) |
| | | } else { |
| | | this.$nextTick(function () { |
| | | this.$router.push({ path: '/' }); //不存在存储,去主页 |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | beforeDestroy() { }, |
| | | }; |
| | | </script> |
| | | <style lang="less"> |
| | | <style lang="less" scoped> |
| | | // #app { |
| | | // font-family: Avenir, Helvetica, Arial, sans-serif; |
| | | // -webkit-font-smoothing: antialiased; |
| | |
| | | scrollbar-face-color: #dfebff; |
| | | /*滚动条整体颜色*/ |
| | | scrollbar-track-color: #536c97; |
| | | |
| | | } |
| | | // ::-webkit-scrollbar-thumb { |
| | | // //滑块部分 |
| | | // background-color: #dfebff; |
| | | // } |
| | | // ::-webkit-scrollbar-track { |
| | | // //轨道部分 |
| | | // box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); |
| | | // background: #536c97; |
| | | // } |
| | | |
| | | |
| | | |
| | | </style> |