react 数据库排序
Often when you have a table with information you'd want to be able to sort the information in the table in ascending or descending order, especially when you are dealing with numbers.
通常,当您拥有一个包含信息的表时,希望能够以升序或降序对表中的信息进行排序,尤其是在处理数字时。
In this tutorial we're going to see how to do exactly that using ReactJS.
在本教程中,我们将看到如何使用ReactJS完全做到这一点。
Here's what we're going to build:
这是我们要构建的:
We have a list of the top 10 billionaires in the world and we want to sort the list based on the net worth of the billionaires. I got the list information from theweek.co.uk website.
我们列出了全球排名前10位的亿万富翁,我们希望根据亿万富翁的净资产对列表进行排序。 我从theweek.co.uk网站上获得了列表信息。
先决条件 (Prerequisites)
Before we move on, let's see the things that we're going to use in this tutorial:
在继续之前,让我们看看在本教程中将要使用的东西:
FontAwesome - for icons
FontAwesome-用于图标
Foundation - for general styling. We're using this especially for the table styling as we don't want to get distracted by the styling in this tutorial
基础 -一般样式。 我们特别将其用于表格样式,因为我们不想被本教程中的样式分散注意力
ReactJS - please note that I'm not going to explain the basics of React in this tutorial. By continuing I'm assuming that you worked with it before (although the things that we're going to do aren't hard at all ?)
ReactJS-请注意 ,我不会在本教程中解释React的基础知识。 通过继续,我假设您以前曾使用过它(尽管我