App.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <div id="app">
  3. <!-- <HelloWorld msg="Welcome to Your Vue.js App"/> -->
  4. <!-- <router-link to='/billing'>11</router-link>
  5. <router-link to="/orderList">Go to Foo</router-link> -->
  6. <!-- <van-tabs v-model:active="active" @click="onClickTab">
  7. <van-tab title="客户资料"></van-tab>
  8. <van-tab title="商品查询"></van-tab>
  9. <van-tab title="销售开单" ></van-tab>
  10. <van-tab title="订单管理" ></van-tab>
  11. </van-tabs> -->
  12. <div class="tt">
  13. <div class="tabline">客户资料</div>
  14. <div class="tabline" :class="{'active':active==2}" @click="onClickTab(2)">商品查询</div>
  15. <div class="tabline " :class="{'active':active==3}" @click="onClickTab(3)">销售开单</div>
  16. <div class="tabline" :class="{'active':active==4}" @click="onClickTab(4)">订单管理</div>
  17. </div>
  18. <div class="hx"></div>
  19. <!-- 展示组件内容 -->
  20. <router-view></router-view>
  21. </div>
  22. </template>
  23. <script>
  24. import HelloWorld from './page/HelloWorld.vue'
  25. export default {
  26. name: 'App',
  27. components: {
  28. HelloWorld
  29. },
  30. data(){
  31. return{
  32. active:3,
  33. }
  34. },
  35. created(){
  36. //console.log("..")
  37. //this.$router.push('/billing')
  38. },
  39. methods:{
  40. goRouter(url){
  41. console.log(url)
  42. this.$router.push(url)
  43. },
  44. onClickTab(e){
  45. console.log(e);
  46. this.active=e
  47. if(e==3){
  48. this.$router.push('/billing')
  49. }else if(e==4){
  50. this.$router.push('/orderList')
  51. }else if(e==2){
  52. this.$router.push('/goodsQuery')
  53. }
  54. }
  55. }
  56. }
  57. </script>
  58. <style >
  59. #app {
  60. font-family: Avenir, Helvetica, Arial, sans-serif;
  61. -webkit-font-smoothing: antialiased;
  62. -moz-osx-font-smoothing: grayscale;
  63. }
  64. .tt{
  65. width: 100%;
  66. display: flex;
  67. border-top: 1px solid #EEEEEE;
  68. border-bottom: 1px solid #EEEEEE;
  69. font-size: 0.3rem;
  70. line-height: 0.88rem;
  71. position: fixed;
  72. left: 0;
  73. top: 0;
  74. background: #ffffff;
  75. }
  76. .hx{
  77. height: 0.88rem;
  78. }
  79. .tabline{
  80. width: 25%;
  81. text-align: center;
  82. }
  83. .active{
  84. color: #3F90F7;
  85. }
  86. </style>