list.vue
618 Bytes
<template>
<div class="list-wrap">
<tab :list="['访客记录', '活动申请']" :index="currentIndex" :sticky="true" @change="changeIndex"></tab>
<component :is="currentComponent"></component>
</div>
</template>
<script>
import index from './index.vue'
import apply from './apply.vue'
export default {
data() {
return {
currentIndex: 0,
currentComponent: 'index'
}
},
components: {
index,
apply
},
methods: {
changeIndex(index) {
this.currentComponent = index == 0 ? 'index' : 'apply'
}
}
}
</script>
<style lang='scss' scoped>
.list-wrap {
}
</style>