feat: 实现前后端数据交互功能
- 添加axios API服务模块,封装所有后端接口调用 - 修改各视图组件,移除模拟数据,改为从后端API获取真实数据 - 更新文章、留言板等页面,支持后端数据渲染 - 添加README_API.md文档,说明API调用方式 - 升级axios依赖版本至1.12.2
This commit is contained in:
@@ -105,10 +105,7 @@ const handleSelect = (key: string) => {
|
||||
*/
|
||||
const updatePageState = (url: string) => {
|
||||
classhero.value = url !== '/:type';
|
||||
console.log("当前路径是:"+url);
|
||||
classnonsenset.value = url == '/nonsense';
|
||||
console.log( classnonsenset.value);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -154,14 +151,12 @@ const handleScroll = () => {
|
||||
isconts.value = true;
|
||||
isScrollingleftmodlue.value = true;
|
||||
}
|
||||
console.log("好耶滚动了");
|
||||
};
|
||||
|
||||
/**
|
||||
* 添加滚动监听
|
||||
*/
|
||||
const addScrollListener = () => {
|
||||
console.log("添加滚动监听");
|
||||
window.addEventListener('scroll', handleScroll);
|
||||
};
|
||||
|
||||
@@ -169,7 +164,6 @@ const addScrollListener = () => {
|
||||
* 移除滚动监听
|
||||
*/
|
||||
const removeScrollListener = () => {
|
||||
console.log("移除滚动监听");
|
||||
window.removeEventListener('scroll', handleScroll);
|
||||
};
|
||||
|
||||
@@ -184,7 +178,6 @@ const handleResize = () => {
|
||||
isScrollingleftmodlue.value = true;
|
||||
classnonsenset.value = false;
|
||||
isconts.value = true;
|
||||
// removeScrollListener();
|
||||
} else {
|
||||
windowwidth.value = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user