<template>
  <div style="height: 100%;">
    <transition name="fade-transform" mode="out-in">
      <keep-alive :include="['Detail']">
        <component ref="component" :is="component" @change="onChange" :params="params"></component>
      </keep-alive>
    </transition>
  </div>
</template>

<script>
  import Detail from './components/Detail.vue'

  export default {
    name: 'BestSellers',
    label: '畅销品',

    components: {
      Detail
    },

    data () {
      return {
        component: 'Detail',
        params: {}
      }
    },

    methods: {
      onChange (data) {
        if (data.type === 'Detail') {
          this.component = 'Detail'
          this.params = data.params
        }
      }
    }
  }
</script>

<style lang="scss" scoped>
</style>

