Display posts in descending posted order

前端 未结 18 1150
南方客
南方客 2020-11-22 11:47

I\'m trying to test out Firebase to allow users to post comments using push. I want to display the data I retrieve with the following;

fbl.child         


        
18条回答
  •  自闭症患者
    2020-11-22 12:07

    I had this problem too, I found a very simple solution to this that doesn't involved manipulating the data in anyway. If you are rending the result to the DOM, in a list of some sort. You can use flexbox and setup a class to reverse the elements in their container.

    .reverse {
      display: flex;
      flex-direction: column-reverse;
    }
    

提交回复
热议问题