Index.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <div class="container">
  3. <div class="bgimg"></div>
  4. <div class="content">
  5. <div class="csbtn" @click="goPage('/doclogin')">医生端</div>
  6. <div class="jbbtn" @click="goPage('/patregister')">个人端</div>
  7. <button class="jbbtn" @click="logout">退出登录</button>
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. export default {
  13. name: 'Index',
  14. data() {
  15. return {
  16. msg: 'Welcome to Your Vue.js App'
  17. }
  18. },
  19. methods: {
  20. goPage(path) {
  21. this.$router.push(path)
  22. },
  23. logout(){
  24. window.localStorage.removeItem('token')
  25. window.localStorage.removeItem('authinfo')
  26. window.location.reload()
  27. }
  28. }
  29. }
  30. </script>
  31. <style scoped lang="scss">
  32. .container {
  33. background:#fff;
  34. .bgimg {
  35. width: 100%;
  36. height: 12.3rem;
  37. margin-top: 3rem;
  38. position: absolute;
  39. background-image: url("../assets/images/entrybg.jpg");
  40. background-image: url("../assets/images/entrybg.jpg");
  41. background-size: 100% 100%;
  42. }
  43. }
  44. </style>