测试效果

This commit is contained in:
2023-06-30 22:10:44 +08:00
parent a7cf93d3e7
commit 626991b2cc
2 changed files with 34 additions and 5 deletions

View File

@@ -22,8 +22,8 @@
<el-main style="display: flex;flex-direction: row;flex-wrap: nowrap;">
<template>
<div>
<el-tabs type="border-card" style="width: 45vw;">
<el-tab-pane label="最热" style="display: flex;justify-content: flex-start">
<el-tabs v-model="activeName" type="border-card" style="width: 45vw;" @tab-click="tabChange">
<el-tab-pane label="最热" name="first" style="display: flex;justify-content: flex-start">
<ul
class="list"
v-infinite-scroll="load"
@@ -35,7 +35,7 @@
<p v-if="loading">加载中...</p>
<p v-if="noMore">没有更多了</p>
</el-tab-pane>
<el-tab-pane label="最新">
<el-tab-pane label="最新" name="second">
<div class="lsm-container">
<el-scrollbar class="scrollbar-wrapper" style="position: relative;">
<div class="infinite-list-wrapper">
@@ -203,6 +203,7 @@ export default {
components: {ProjectList},
data() {
return {
activeName:'first',
count: 10,
loading: false,
loginDialogVisible: false,
@@ -437,7 +438,27 @@ export default {
this.count += 2
this.loading = false
}, 2000)
},
tabChange(tab, event){
console.log(tab, event);
if (tab.name == "first") {
axios({
method: 'get',
// 请求的地址
url: 'http://localhost:8082/helloGithub_war_exploded/selectLastByCate',
// URL 中的查询参数
params: {
num: 0,
}
}).then(function (res){
console.log(res);
});
} else if (tab.name == "second") {
//网络请求2
}
}
}
}
</script>