<template>
  <div class=" pt-4 px-5 divide-y">
    <component :is="type" v-for="item in lists" :key="item.uuid" :info="item"></component>
  </div>
</template>

<script lang="ts">
import { computed, defineComponent, ref } from 'vue'
import { useRoute } from 'vue-router'
import NewsList from "@/views/News/NewsList/index.vue"
import PolicyCard from '@/components/PolicyCard/index.vue'

export default defineComponent({
  components:{ NewsList,PolicyCard },
  props: {
    lists: {
      type: String
    }
  },
  setup () {
    const route = useRoute()
    const types = route.query.type
    let result = types === 'news' ? ref("NewsList") : ref('PolicyCard')
    const type = computed(()=>{
      return result.value
    })
    return {
      type
    }
  }
})
</script>

<style scoped>

</style>