index.vue 591 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <div class="loginBox">
  3. <button @click="handleLogin">登录</button>
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. redirect: undefined
  11. }
  12. },
  13. watch: {
  14. $route: {
  15. handler: function(route) {
  16. this.redirect = route.query && route.query.redirect
  17. },
  18. immediate: true
  19. }
  20. },
  21. methods: {
  22. handleLogin() {
  23. this.$router.push({ path: this.redirect || '/' })
  24. }
  25. }
  26. }
  27. </script>
  28. <style lang="scss" scoped>
  29. .loginBox {
  30. position: relative;
  31. width: 100vw;
  32. height: 100vh;
  33. overflow: hidden;
  34. }
  35. </style>