<script setup lang="ts">
const props = defineProps({
  fromWeb:String,
  limit:Number
})
interface NewHot{
  id: number,
  word:string
}
const nowHotLoading = ref(true)
const tableData = reactive<NewHot[]>([])
$fetch(`https://data.zziyu.cn/hot/new/${props.fromWeb}?limit=${props.limit}`).then(dataRaw=>{
  let data=dataRaw as unknown as NewHot[]
  data.map(d=>tableData.push(d))
  nowHotLoading.value=false
})


</script>

<template>
    <el-table v-loading="nowHotLoading" :data="tableData" stripe style="width: 300px;">
      <el-table-column prop="word" :label="`实时 ${props.fromWeb} 热搜 Top${props.limit}`" width="300px" />
<!--      <el-table-column prop="name" label="Name" width="180" />-->
<!--      <el-table-column prop="address" label="Address" />-->
    </el-table>
</template>

<style scoped>

</style>