reverse list

This commit is contained in:
2023-03-16 23:43:49 +08:00
parent 1c8a3e1462
commit bebb447498

View File

@@ -91,7 +91,13 @@ export function App() {
NEW NEW
</button> </button>
<ul> <ul>
{allChatStore.map((cs, i) => ( {allChatStore
.slice()
.reverse()
.map((cs, _i) => {
// reverse
const i = allChatStore.length - _i - 1;
return (
<li> <li>
<button <button
className={`w-full my-1 p-1 rounded hover:bg-blue-300 ${ className={`w-full my-1 p-1 rounded hover:bg-blue-300 ${
@@ -104,7 +110,8 @@ export function App() {
{i} {i}
</button> </button>
</li> </li>
))} );
})}
</ul> </ul>
</div> </div>
<button <button