vuejs通过filterBy、orderBy实现搜索筛选、降序排序数据

直接贴代码了:

先上输入前的样子:

#example{margin:100px auto;width:600px;} .show{margin:10px;} #searchText{display: block;margin:0 auto 10px;height:24px;line-height: 24px;width:200px;} .content ul li{text-align: center;} .content ul li span{display: inline-block;width:150px;font-size:15px;color:#000;}
  • {{item.id}} {{item.name}} {{item.time}}
  • 当在输入框中输入'合同',得到结果如图:

    以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程之家。

    相关文章

    这篇文章我们将通过debug源码的方式来带你搞清楚defineAsync...
    欧阳老老实实的更新自己的高质量vue源码文章,还被某2.6k st...
    前言 在Vue3.5版本中响应式 Props 解构终于正式转正了,这个...
    组合式 (Composition) API 的一大特点是“非常灵活”,但也因...
    相信你最近应该看到了不少介绍Vue Vine的文章,这篇文章我们...
    前言 在欧阳的上一篇 这应该是全网最详细的Vue3.5版本解读文...