no message
This commit is contained in:
Generated
+942
File diff suppressed because it is too large
Load Diff
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user