在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. Redis Cluster 官方集群搭建指南

    安装ruby环境因为官方提供的创建集群的工具是用ruby写的,需要ruby2.2.2+版本支持,ruby安装需要指定openssl. 安装openssl $ wget https://www.open ...

  2. git获取特定版本的代码

    比如取1.80版本 git clone -b https://github.com/passedbylove/poiji.git

  3. linux之文件目录,输入及输出

    文件目录结构 ls 查看文件 ll 查看详细文件 文件和目录被组织成一颗倒置的树状结构 文件系统从根开始,'/' 文件名严格区分大小写 隐藏文件以.开头 文件的分隔符为'/' 文件命名规范 文件字符最 ...

  4. 配置 Nginx 错误页面优雅显示

    [root@localhost ~]# cat /usr/local/nginx/conf/nginx.conf ...... http { location / { root html/www; i ...

  5. C语言:二维数组,(杨辉三角)

    二维数组:一维数组中的元素又是一个数组.声明的语法:数据类型 数组名[一维长度][二维长度]; int num[3][2]; 注意:int[][2];正确 int[2][];错误 二维数组中: 一维可 ...

  6. 并发编程之原子Atomic&Unsafe

    1.原子更新基本类型类   用于通过原子的方式更新基本类型,Atomic包提供了以下三个类: AtomicBoolean:原子更新布尔类型. AtomicInteger:原子更新整型. AtomicL ...

  7. vs code 设置 保存自动格式化vue代码

    配置 ESLint (需安装 Prettier - Code formatter 插件) command + shift + p  打开用户设置 // vscode默认启用了根据文件类型自动设置tab ...

  8. sqlalchemy基本的增删改查

    #encoding: utf-8 from sqlalchemy import create_engine,Column,Integer,String from sqlalchemy.ext.decl ...

  9. 访问https接口报错 基础连接已经关闭: 未能为 SSL/TLS 安全通道建立信任关系

    详细错误信息如下 请求错误信息:发生一个或多个错误.System.Net.Http.HttpRequestException: An error occurred while sending the ...

  10. 关于js查找和筛选和循环的几种方式

    find(); find() 方法返回通过测试(函数内判断)的数组的第一个元素的值. find() 方法为数组中的每个元素都调用一次函数执行: 当数组中的元素在测试条件时返回 true 时, find ...