vue项目,严格模式下报警告[Vue warn]: Property or method tableData is not defined on the instance

news/2024/7/10 2:10:59 标签: vue, js, html5, node.js, es6

[Vue warn]: Property or method “tableData” 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

最近我用的vue项目启用了严格模式,下面记录下严格模式下自己代码的不规范导致的报的警告
在这里插入图片描述
这个是在view用到的字段但是在data里面没有事先去声明这个字段导致的报警告,

[Vue warn]: Missing required prop: “value”

found in

在这里插入图片描述
意思是说数据没有绑定,页面缺少value值。应该v-model进行数据绑定。
应该要这样
在这里插入图片描述

[Vue warn]: Invalid prop: type check failed for prop “disabled”. Expected Boolean, got Number with value 1.

在这里插入图片描述
这个就是类型不匹配,虽然判断用的v-if=“0” 和1 也能,但在严格模式下就会报警告的,
在这里插入图片描述
可以加!!双冒号转换成布尔值,切记前端规范,声明对应的类型就要匹配对应的类型,不要随意
目前就暂时发现这几个,后续再发现再更新下


http://www.niftyadmin.cn/n/1162379.html

相关文章

Java面向对象思维导图总结

自己学习总结了一些思维导图(持续更新中),后面附有GitHub链接 ,分享给大家。https://github.com/panjianlong13/MindMapSummary

[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent

[Vue warn]: Avoid 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 这个意思是父组件传值到子组件里面的,然…

Java常用类思维导图总结

自己学习总结了一些思维导图(持续更新中),后面附有GitHub链接 ,分享给大家。https://github.com/panjianlong13/MindMapSummary

webpack.optimize.CommonsChunkPlugin has been removed, webpack学习坑(二)

webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead webpack配置报错,按照中文文档配置的 plugins: [ new CleanWebpackPlugin(), new HtmlWebpackPlugin({ title: Output Management }), new webpack.Na…

Java集合思维导图总结

自己学习总结了一些思维导图(持续更新中),后面附有GitHub链接 ,分享给大家。https://github.com/panjianlong13/MindMapSummary

每日一题 :(京东)写出如下代码的打印结果(javascript中Object对象指向 形参和实参的区别)

function changeObjProperty(o) { o.siteUrl “http://www.baidu.com” o new Object() o.siteUrl “http://www.google.com” } let webSite new Object(); changeObjProperty(webSite); console.log(webSite.siteUrl); 答案是"http://www.baidu.com" 为什么呢…

Java IO思维导图总结

自己学习总结了一些思维导图(持续更新中),后面附有GitHub链接 ,分享给大家。https://github.com/panjianlong13/MindMapSummary

前端每日一题:(头条)[1,2,3].map(parseInt) what why

[‘1’, ‘2’, ‘3’].map(parseInt) what & why ? 让我们先来了解一下map函数和 parseInt吧 map map() 方法返回一个新数组,数组中的元素为原始数组元素调用函数处理后的值。array.map(function(currentValue,index,arr), thisValue) 接收的是一个函数 函…