???
???? ??? ???? ??? ?????. ??? ? ?? ??(?: ?? ??? ??)? ???? ?? ??? ???? ??? ????? ???. ??, ??? ??? ??? ???? ?? ????? ?? ??? ????? ???.
??? ??? ????? ???? ??. ??? ???? ?????? ??? ????? ????. ??? ?? ???? ??? ????.
? ??? ????? ? ?? ??? ?????.
?? ??? ???? ?????? ???. ???? ??? ??? ?? ?? ?? ?? sourceInfo
? ???? ?? ????. ??? HTML ??? ???? ?????
??? ??? ??? sourceInfo
? ???? ?? ???? ???? ????? ???? ??? ??? ?? ???? ????? ???. ??? ??? ??? ????.
??? ??? ??? ???? ?? ??? this.userList
更改為 this.users
? ???? ???.
? ?? ??? ?????:
????? ???? ??? ?? ??? ????? ???? ??? ???? ?? ???? boolean
上應(yīng)用 sort()
函數(shù),該函數(shù)預(yù)計(jì)由 includes()
函數(shù)返回。因此,作為最后一步,刪除過濾器的 sort()
???? ??? ????.
?? ?? ??? ?????. ?? ???? ??? ???? nok
,即使一個(gè)用戶具有相應(yīng)的狀態(tài),也會(huì)返回一個(gè)空數(shù)組。這是因?yàn)橄吕?nok
已分配值 notok
。因此,只需將值更改為 nok
? ?? ??? ??? ? ????.
??? ???? ?????? ??? ??? ????: https://codesandbox.io/s/vue-sort-problem-hgdm7?file=/src/comComponents/HelloWorld.vue