在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. Python全栈开发第5天作业

    作业一:1) 将用户信息数据库文件和组信息数据库文件纵向合并为一个文件/1.txt(覆盖) 2) 将用户信息数据库文件和用户密码数据库文件纵向合并为一个文件/2.txt(追加) 3) 将/1.txt. ...

  2. VLOOKUP的了解(1)

    上周在整理资料的时候,需要将一个表中的部分东西,弄到另外一张表中.我就傻不愣登的直接粘贴.复制.没有发现VLOOKUP呀! VLOOKUP是一个查找函数,给定一个查找的目标,它就能从指定的查找区域中查 ...

  3. Fragment全解析系列

    (一):那些年踩过的坑 开始之前 最新版知乎,单Activity多Fragment的架构,响应可以说非常“丝滑”,非要说缺点的话,就是没有转场动画,并且转场会有类似闪屏现象.我猜测可能和Fragmen ...

  4. PHP安装 (结合之前的nginx安装与mysql安装组合为lnmp)

    检查安装PHP所需的lib库 yum -y install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-de ...

  5. SpringBoot解决ajax跨域问题(转载)

    一.第一种方式: 1.编写一个支持跨域请求的 Configuration import org.springframework.context.annotation.Configuration; im ...

  6. Spring学习之==>IoC

    一.概述 Spring的三大核心思想:IoC(控制反转),DI(依赖注入),AOP(面向切面编程).本问讲着重介绍一下控制反转. 何谓控制反转:Spring 通过一种称作控制反转(IoC)的技术促进了 ...

  7. visual studio 2019 中初始化 vue.js 项目

    vs项目模板,webpack模板的创建方式在vs里创建后,npm install的过程会卡很久,暂时原因不明,感觉应该是文件太多,需要写入太多零碎文件. 试了几种初始化方法,还是用最新cli创建最好, ...

  8. oracle增、删、改、查

    参照文档 https://blog.csdn.net/yes_is_ok/article/details/79271965 https://blog.csdn.net/cl723401/article ...

  9. 12 mysql性能抖动

    12 mysql性能抖动 sql语句为什么变”慢”了 在介绍WAL机制时,innodb在处理更新语句的时候,只做了写日志这一个磁盘操作,就是redo log,在更新内存写完redo log之后,就返回 ...

  10. appium+python+windows环境配置

    一.安装node.js 1:先找到对于电脑合适的node版本进行下载. 我的云盘node版本是7.8.0.地址如下:https://pan.baidu.com/s/19kcpXhCN1AuJAT9CB ...