<template>
  <div class="AppCountryAlbum">
    <component v-if="refresh" :is="component" @change="onChange" :params="params"/>
  </div>
</template>

<script>
import Detail from './detail'
import List from './list'

export default {
  name: 'AppCountryAlbum',
  appName: '乡村相册',

  data() {
    return {
      component: 'List',
      params: {},
      refresh: true
    }
  },

  components: {Detail, List},
  onShow() {
    document.title = "乡村相册"
    this.handleRefresh()
  },
  methods: {
    onChange(e) {
      this.params = e.params
      this.component = e.type
    },
    handleRefresh() {
      this.refresh = false
      this.$nextTick(() => {
        this.refresh = true
      })
    }
  },
}
</script>

<style lang="scss" scoped>
uni-page-body {
  height: 100%;
}

.AppCountryAlbum {
  height: 100%;
}
</style>
