CardIndex.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <el-container direction="vertical">
  3. <el-tabs type="border-card" style="height: 100%;" v-model="selectedTab">
  4. <el-tab-pane label="Поиск">
  5. <Search></Search>
  6. </el-tab-pane>
  7. <el-tab-pane label="Автор">
  8. <Card></Card>
  9. </el-tab-pane>
  10. <el-tab-pane label="Книга">
  11. <Book></Book>
  12. </el-tab-pane>
  13. <el-tab-pane label="История">
  14. <History></History>
  15. </el-tab-pane>
  16. {{ this.$route.path }}
  17. </el-tabs>
  18. </el-container>
  19. </template>
  20. <script>
  21. //-----------------------------------------------------------------------------
  22. import Vue from 'vue';
  23. import Component from 'vue-class-component';
  24. import Search from './Search/Search.vue';
  25. import Card from './Card/Card.vue';
  26. import Book from './Book/Book.vue';
  27. import History from './History/History.vue';
  28. export default @Component({
  29. components: {
  30. Search, Card, Book, History
  31. },
  32. watch: {
  33. selectedTab: function(newValue, oldValue) {
  34. switch (newValue) {
  35. case '0': this.$router.push('/cardindex/search'); break;
  36. case '1': this.$router.push('/cardindex/card'); break;
  37. case '2': this.$router.push('/cardindex/book'); break;
  38. case '3': this.$router.push('/cardindex/history'); break;
  39. }
  40. },
  41. },
  42. })
  43. class CardIndex extends Vue {
  44. selectedTab = null;
  45. created() {
  46. }
  47. }
  48. //-----------------------------------------------------------------------------
  49. </script>
  50. <style scoped>
  51. </style>