添加热搜点击跳转

This commit is contained in:
ZtRXR 2023-09-02 13:43:20 +08:00
parent 9567cc63b9
commit 782a5f7200

View File

@ -25,23 +25,21 @@ rawData.forEach(d=>{
newD.lastTime=aDate.toLocaleString()
data.push(newD)
})
const router = useRouter()
const gotoWeb = (row, column, cell, event)=>{
// console.log(row.fromWeb.searchUrl+row.word)
window.open(row.fromWeb.searchUrl+row.word,"_blank")
}
</script>
<template>
<client-only>
<el-table :data="data" style="width: 75%;margin: 10px;margin-bottom: 15px" :table-layout="'fixed'">
<el-table :data="data" style="width: 90%;max-width: 600px;margin: 10px;margin-bottom: 15px" :table-layout="'fixed'" @cell-click="gotoWeb">
<el-table-column prop="word" :label="props.fromWeb+'热搜'" width="180" />
<el-table-column prop="lastTime" label="最后上榜" width="180" />
<el-table-column prop="times" label="上榜次数" />
</el-table>
</client-only>
</template>
<style scoped>