import React , { Component } from 'react'; import { Menu , Input , Dropdown , Icon, Result } from 'antd'; import { Link } from 'react-router-dom'; import '../css/index.css' import './list.css'; import ListItem from './IndexItem' import axios from 'axios'; const Search = Input.Search; const { SubMenu } = Menu; class Index extends Component{ constructor(props){ super(props); this.state={ projectsList:undefined, page:1, limit:15, search:undefined, sort:undefined } } componentDidMount=()=>{ const { page,limit, search , sort } = this.state; this.getListData(page,limit, search , sort); } getListData=(page,limit, search , sort)=>{ const { current_user } = this.props; const url = `/projects.json`; axios.get(url,{params:{ user_id:current_user && current_user.user_id, page, limit, name:search, sort_by:sort }}).then((result)=>{ if(result){ this.setState({ projectsList:result.data }) } }).catch((error)=>{}) } render(){ const menu=( 1st menu item 2nd menu item ) const { projectsList } = this.state; return(
console.log(value)} className="list-r-Search" /> 排序
) } } export default Index;