ant [Vue warn]: Invalid prop: custom validator check failed for prop "pagination".错误

2020-05-15 22:40:15

遇到这样的问题,一般是props中的pagination有值不匹配造成的

我们可以通过打印数据检测一下有没有赋给其空值


参考地址 https://www.cnblogs.com/vipsoft/p/AntVue.html

遇到的错误如下:

 [Vue warn]: Invalid prop: custom validator check failed for prop "pagination".


found in


---> <ATable>

       <ACard>

         <UserTerminal> at src/views/om/userTerminal/UserTerminal.vue

           <RouteView> at src/layouts/RouteView.vue... (1 recursive calls)

             <Anonymous>

               <ALayoutContent>

                 <Anonymous>

                   <ALayout>

                     <Anonymous>

                       <ALayout>

                         <BasicLayout> at src/layouts/BasicLayout.vue

                           <ALocaleProvider>

                             <App> at src/App.vue

                               <Root>


错误提示:在model之下的table里有错误,pagination类型无法准确插入。

最后排查出来的结果是获取后端数据后将结果集的total赋值给了pagination.total

this.$http({

        url: '/getUserTerminalList',

        method: 'post',

        data: this.formData

      }).then(res => {

        this.datas = res.list

        this.pagination.total = res.total

      })


将this.pagination.total = res.total删除即可


  • 2020-03-21 12:05:24

    android 自定义组件,使用AttributeSet

    首先要在res/values目录下建立一个attrs.xml(名字可以自己定义)的文件,并在此文件中增加对控件的属性的定义.其xml文件如下所示:

  • 2020-03-21 12:09:59

    Android使用AttributeSet自定义控件的方法

    我们可以在attrs.xml中声明自己控件的属性,在布局xml文档中声明自己的命名空间,这时就可以对设置自己想要的值了,然后在AttributeSet这个属性中获取对应的值。好了不多说,我们来看下代码,一切尽在不言中:

  • 2020-03-22 21:16:07

    用vue做的跟随鼠标移动的div

    最近接到一个任务,就是在既存用electron-vue开发的桌面端程序上追加随鼠标移动的动画效果,之前一直使用angular和react,没怎么接触过vue,先做一个vue的简单例子,然后再整合。

  • 2020-03-23 15:16:30

    import,require具体用法

    import 和 require 是JS模块化编程使用的,是前端开发者们在性能探索中的又一大进步。

  • 2020-03-30 15:37:12

    PM2下使用 npm run 命令

    npm run xxxx 是 node常用的启动方式之一,本文介绍下如何用PM2来实现该方式的启动。 下面是项目的package.json文件部分代码: