Files
dvcp_v2_wxcp_app/src/project/caw/AppCountryAlbum/components/Tabbar.vue

65 lines
1.3 KiB
Vue
Raw Normal View History

2022-03-08 10:35:29 +08:00
<template>
<div class="form-wrapper">
<div class="form-content">
<Home ref="Home" v-if="currIndex === 0" @change="onChange"/>
<Organize ref="Organize" v-if="currIndex === 1" @change="onChange"/>
</div>
<AiTabbar :active.sync="currIndex" :list="tabBar"/>
</div>
</template>
<script>
import Home from './Home.vue'
import Organize from './Organize.vue'
export default {
2022-05-27 15:27:07 +08:00
name: 'Tabbar',
2022-05-30 14:15:15 +08:00
appName: '工作相册',
2022-03-08 10:35:29 +08:00
data() {
return {
currIndex: 0
}
},
components: {
Home,
Organize
},
computed: {
tabBar() {
2022-06-01 10:05:20 +08:00
const link = icon => `${this.$cdn}watermark/${icon}.png`
2022-03-08 10:35:29 +08:00
return [
2022-06-01 10:05:20 +08:00
{text: "相册", iconPath: "xiangce", selectedIconPath: "xiangce-active"},
{text: "组织", iconPath: "zuzhi", selectedIconPath: "zuzhi-active"}
2022-03-08 10:35:29 +08:00
].map(e => ({
...e,
iconPath: link(e.iconPath),
selectedIconPath: link(e.selectedIconPath)
}))
}
},
methods: {
onChange(e) {
this.$emit('change', e)
},
show() {
if (this.currIndex == 0) {
this.$nextTick(() => {
2022-05-30 15:45:02 +08:00
this.$refs.Home.update()
2022-03-08 10:35:29 +08:00
})
}
}
},
onReachBottom() {
if (this.currIndex === 0) {
}
}
}
</script>
<style lang="scss" scoped>
</style>