App.vue 590 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <div id="app">
  3. <headerNav :username="uname" @quit="quit"></headerNav>
  4. <router-view @chuanzhi="chuanzhi" :isquit="isquit"></router-view>
  5. </div>
  6. </template>
  7. <script>
  8. import headerNav from "./components/header-nav"
  9. export default {
  10. name: 'App',
  11. data(){
  12. return{
  13. uname:"",
  14. isquit:true
  15. }
  16. },
  17. components:{
  18. headerNav
  19. },
  20. mounted(){
  21. },
  22. methods:{
  23. chuanzhi(data){
  24. this.uname=data
  25. this.isquit=false
  26. },
  27. quit(){
  28. this.uname=""
  29. this.isquit=true
  30. }
  31. }
  32. }
  33. </script>
  34. <style>
  35. #app {
  36. background-color: #f5f8ff;
  37. }
  38. </style>