Property or method “selectFilter“ is not defined on the instance but referenced during render. Make

简介: vue2 bug

一.控制台报错截图

Snipaste_2023-08-07.png

二.出现bug的原因

属性或方法“selectFilter”未在实例上定义,但在渲染过程中被引用。通过初始化该属性,确保该属性在数据选项中是被动的,或者对于基于类的组件是被动的。

可能出现的原因:

父组件传值给子组件,子接收接收数据时没写在props里

调用的函数和创建的函数名不一致

代码中用到的变量没在data中声明就用了(变量名不一致)

这种bug不会影响开发过程中的运行,但是测试必报错,太狗了。

我的原因是函数名多了个s
Snipaste_2023-08-07_08-02-22.png
Snipaste_2023-08-07_08-00-33.png

相关文章
|
9月前
|
JavaScript
Property “selectedItemIndex“ was accessed during render but is not defined on instance. 报错解决
Property “selectedItemIndex“ was accessed during render but is not defined on instance. 报错解决
742 0
|
8月前
Each child in a list should have a unique “key“ prop. Check the render method的报错解决
Each child in a list should have a unique “key“ prop. Check the render method的报错解决
|
9月前
|
设计模式 JavaScript 前端开发
Vue3报错Property “xxx“ was accessed during render but is not defined on instance
Vue3报错Property “xxx“ was accessed during render but is not defined on instance
Unknown custom element: <add-employee> - did you register the component correctly? For red cursive c
原因: 1.组件名没写对(导入和注册不对应) 2.components少写了个s 3.组件命名最好是驼峰命名 4.导入时语法错误 5.代码中有两个components,后一个的值把前一个覆盖了 6.组件直接循环套用了
110 0
|
JavaScript 算法 前端开发
Property xxx was accessed during render but is not defined on instance
目前el-form的model主要用表单验证的,也就是配合el-form的rules和el-form-item的prop来使用的。不信的话,你可以增加一个rules和prop(为了调用验证方法,也el-form也加一个ref属性,相当于id或者class选择器的意思),但是不写model,然后验证的话,会提示缺少model,导致无法验证成功。
Property xxx was accessed during render but is not defined on instance
|
Java
The type XXX cannot be resolved. It is indirectly referenced from required .class files
The type XXX cannot be resolved. It is indirectly referenced from required .class files
164 0
Duplicate methods named spliterator with the parameters () and () are inherited from the types Colle
Duplicate methods named spliterator with the parameters () and () are inherited from the types Colle
82 0
|
JavaScript
void mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property b
void mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: vue项目示例,请参考甄佰 单向数据流所有的 prop 都使得其父子 prop 之间形成了一个单向下行绑定:父级 prop 的更新会向下流动到子组件中,但是反过来则不行。
3446 0
No enclosing instance of type SmsUtils is accessible. Must qualify the allocation with an enclosing
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px '.SF NS Text'} No enclosing instance of type SmsUtils is accessible. Must qualify the allocation with an enclosing instance of type SmsUtils (e.g. x.new A() where x is an instance of SmsUtils). 今天在写一个短信发送的工具类时使用到了内部类,在实例化内部类时遇到此错误。
1468 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等