| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <template>
- <div class="tab">
- <div class="tab-header">
- <div
- v-for="item in header"
- :key="item.key"
- :class="`header-menu ${item.key===nowKey?'menu-now':''}`"
- >
- {{item.text}}
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- name: "qTab",
- props:{
- header: {
- default(){
- return []
- }
- }
- },
- data(){
- return {
- nowKey: this.header.length?this.header[0].key:''
- }
- }
- }
- </script>
- <style scoped>
- .tab{
- width: 100%;
- height: auto;
- }
- .tab-header{
- width: 100%;
- height: 35px;
- display: flex;
- }
- .tab-header .header-menu{
- padding: 5px 15px;
- border-radius: 3px;
- }
- </style>
|