no message

This commit is contained in:
chenxuan
2024-04-19 18:06:33 +08:00
parent 0a25c95a2e
commit e2447983e2
7 changed files with 984 additions and 1 deletions
+942
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -9,6 +9,8 @@
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"antd": "^5.6.1",
"axios": "^1.6.8",
"babel-jest": "^27.4.2",
"babel-loader": "^8.2.3",
"babel-plugin-named-asset-import": "^0.3.8",
+4 -1
View File
@@ -1,9 +1,12 @@
import React from "react";
import List from "./list/index";
import Search from "./search/index";
class App extends React.Component {
render() {
return (
<div>
<h1>Hello World</h1>
<List></List>
<Search></Search>
</div>
);
}
@@ -0,0 +1,9 @@
import React from 'react';
class List extends React.Component {
render() {
return (
<div>list</div>
);
}
}
export default List;
@@ -0,0 +1,27 @@
import React from "react";
import { UserOutlined } from '@ant-design/icons';
import axios from "axios";
import { Input } from 'antd';
// import PubSub from 'pubsub-js'
class Search extends React.Component {
state = {
value: "",
list: []
};
search = () => {
let keyword = this.state.value;
axios.get(`search/users?q=${keyword}`)
.then((response)=>{
console.log(response.data.items)
})
.catch((err)=>{
})
}
render(){
return (
<Input size="large" placeholder="large size" prefix={<UserOutlined />} />
)
}
}
export default Search;