发表于: 2020-01-16 23:27:10

1 1571



今天完成的事情:

1.搜索功能


明天计划的事情:

1.推进任务,上传等功能


遇到的问题和收获:

1.

queryInfo: {
   size: 10,//当前每页显示多少条数据
   page: 1,//当前页数
   type: 1,//类型,0-首页banner 1-找职位banner  2-找精英banner 3-行业大图
   status: 1,//状态,1-草稿 2-上线
   startAt: 1,//起始更新时间
   endAt: 1//终止更新时间
}


搜索按钮处,会在原路由上添加type,status等新的参数,所以直接用query会直接把原来的页码等参数覆盖点,所以此处用了合并,将原来的参数和新的参数拼接在一起。

这样尝试的,不过刷新后这个新路由参数保留不下来,不知道为啥。可能是用了合并吧,之前写在query里面都可以保留下来

search() {
   this.$router.push({
       path: this.$route.path,
       // name:'admin',
       // query: {
       //     type: this.queryInfo.type,
       //     status: this.queryInfo.status,
       // }
       query: merge(
           this.$route.query,
           {
               startAt:this.queryInfo.startAt,
               endAt:this.queryInfo.endAt,
               type: this.queryInfo.type,
               status: this.queryInfo.status,
           }
       )
   })
   // this.getArticleList()
}


日期的参数如果传个1进去,会默认显示到1970年。这个应该就是时间戳的长度问题了。



先解决一下路由添加新的参数。嗯





返回列表 返回列表
评论

    分享到