在Vue中定义方法或者属性时,因为粗心疏忽可以能会报该错误

[Vue warn]: Property or method "search" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.

属性或方法“search”不是在实例上定义的,而是在呈现期间引用的。通过初始化该属性,确保该属性是反应性的,无论是在data选项中,还是对于基于类的组件。

可以检查三个方面:

1.是否将该属性或方法放在 methods 中,尤其是methods 有没有写对。

2.在methods中是否定义了该方法。

3.如果方法中传了参数,这个参数有没有在 data 中 设置默认值

以上三方面没有解决:methods 中的方法的放的位置是否正确,括号太多了,可能发生嵌套错误。

Vue报错:Property or method "XXX" is not defined on the instance but referenced during render. Make sure that this property is reactive...的更多相关文章

  1. Property or method "previewUrl" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components,

    Property or method "previewUrl" is not defined on the instance but referenced during rende ...

  2. Property or method "openPageOffice" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by

    Property or method "openPageOffice" is not defined on the instance but referenced during r ...

  3. Property or method "xxx" is not defined on the instance but referenced during render

    是xxx中的data写成date了,因此报错. 这个错误属于粗心

  4. Property or method "cancleInput" is not defined on the instance but referenced during render.

    因为我的点击事件,是动态添加上去的 报错如标题  [Vue warn]: Property or method "cancleInput" is not defined on th ...

  5. vue.js使用vue-preview做移动端缩略图时报错Property or method "$preview" is not defined

    报错的详细信息为: Property or method "$preview" is not defined on the instance but referenced duri ...

  6. vue报错信息

    1.Property or method "xxx" is not defined on the instance but referenced during render. 原因 ...

  7. Vue报错笔记

    1.错误信息:[Vue warn]: Property or method "object" is not defined on the instance but referenc ...

  8. Vue 报错Error in render: “TypeError: Cannot read properties of null (reading ‘xxx’)” found in

    前端vue报错 [Vue warn]: Error in render: "TypeError: Cannot read properties of null (reading 'name' ...

  9. Vue报错 type check failed for prop “xxx“. Expected String with value “xx“,got Number with value ‘xx‘

    vue报错    [Vue warn]: Invalid prop: type check failed for prop "name". Expected String with ...

随机推荐

  1. GPS定位RTK解决方案

    GPS差分: 实时差分定位是指在测量点上实时得到高精度的定位结果.这种模式的具体方法是:在一个已知测站上架设GPS基准站接收机和数据电台,连续跟踪所有可见卫星,并通过数据电台向移动站发送差分改正数据. ...

  2. Hibernate系列1:入门程序

    1.传统的java数据库连接 在传统的开发中,如果要建立java程序和数据库的连接,通常采用JDBC或者Apache Commons DbUtils开发包来完成.他们分别有以下特点: JDBC: 优点 ...

  3. C#产生随机验证码的代码

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  4. Ubuntu16.04使用apt安装完nginx常见问题

    1.安装完并remove掉后重新install后没nginx.conf文件 解决办法: apt-get -y --purge remove nginx* apt-get -y autoremove a ...

  5. 判断对象当中有没有某一个属性(AS,JS,Java语言比较)

    1.AS 首先说说AS里面如何判断,AS现在很少用这个语言了,当时我们公司的项目当中还有,所以就拿出来一块比较一下,代码如下: //利用Object属性判断 if("name" i ...

  6. [iOS]UIWebView返回和NSURLErrorDomain-999

    1.UIWebView实现返回不崩溃: -(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)r ...

  7. Nginx实现负载均衡的方式有哪几种呢?

    什么是负载均衡 当一台服务器的单位时间内的访问量越大时,服务器压力就越大,大到超过自身承受能力时,服务器就会崩溃.为了避免服务器崩溃,让用户有更好的体验,我们通过负载均衡的方式来分担服务器压力. 我们 ...

  8. 学习ansible笔记1

    ansible的特点: -- 模块化设计 -- 仅需要ssh和Python即可以使用 -- 无客户端 -- 功能强大,模块丰富 -- 上手容易门槛低 -- 基于python开发,做二次开发更容易 -- ...

  9. Linux C/C++基础——变量作用域

    1.局部变量 局部变量也叫auto自动变量(auto可写可不写),一般情况下代码块{}内部定义的变量都是自动变量,它有如下特点: 只有当执行到这句语句时,系统才为这个变量分配空间 在一个函数内定义,只 ...

  10. KETTLE 主键不唯一解决方法

    SELECT 某一列, COUNT( 某一列 ) FROM 表 GROUP BY 某一列 HAVING