报错:[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the paren
今天在做Vue的时候,子组件关闭的时候,报如下错误
报错:vue.esm.js?65d7:610 [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: "isVisible"
问题解决:
父组件里面调用子组件的代码
<NoteBookLimitFlow :isVisible="isShowFlowSearch"></NoteBookLimitFlow>
isVisible用来判断是否显示子组件
子组件里面的代码
<el-dialog title="XXXX"
:visible.sync="IsShowPage"
@close="closeForm()">
</el-dialog> watch: {
isVisible(val) {
this.IsShowPage = val;//新增isVisible的watch,监听变更并同步到IsShowPage上
}
}, data() {
return {
//定义一个IsShowPage来接收传递过来的值
IsShowPage: this.isVisible,
}
}
报错:[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the paren的更多相关文章
- vue报错 [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
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent c ...
- Vue 报错[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders
场景:父组件向子组件传递数据,子组件去试图改变父组件数据的时候. 解决:子组件通过事件向父组件传递信息,让父组件来完成数据的更改. 比如:我的父组件是普通页面,子组件是弹窗的登录界面,父组件传递的数据 ...
- Vue报错之"[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead......"
一.报错截图 [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the p ...
- [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
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent c ...
- 报错:[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 bei
项目中遇到父组件传值 activeIndex <Tabs :tabs="tabs" :activeIndex="activeIndex" >< ...
- Avoid mutating a prop directly since the value will be overwritten whenever the parent component re
子组件修改父组件的值踩坑 Vue1.0升级至2.0之后,直接在子组件修改父组件的值是会报错的 目的是为了阻止子组件影响父组件的数据. 我们都知道在vue中,父组件传入子组件的变量是存放在props属性 ...
- Vue avoid mutating a prop directly since the value will be overwritten
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- (复习)父子组件传值使用v-modal双向绑定,报错Avoid mutating a prop directly解决方案
报错:Avoid mutating a prop directly since the value will be overwritten whenever the parent component. ...
- Vue 错误:Avoid mutating a prop directly
Avoid mutating a prop directly since the value will be overwritten whenever the parent component re- ...
随机推荐
- 关于if else 和 三目运算符的效率问题-java
1.从类型转换上看,因为三目运算符在做判断的时候需要考虑到类型转换的问题,而if else 不需要考虑类型转换. 所以 if else 效率高一点. 2.从总体上看 A:需要考虑到循环自身所占用的时间 ...
- Confluence 6 站点备份和恢复
Atlassian 推荐针对生产环境中安装使用的 Confluence 使用原始数据库工具备份策略. 在默认的情况下,Confluence 每天都会备份所有数据和附件到 XML 文件备份中.这些文件被 ...
- 【Flutter学习】基本组件之图标组件Icon
一,概述 图标组件(Icon)为展示图标的组件,该组件不可交互,要实现可交互的图标,可以考虑使用IconButton组件. 图标组件相关的几个组件: IconButton:可交互的Icon: Icon ...
- php 实现的功能
1.php写日志函数 (如:前端请求日志记录) : https://www.cnblogs.com/lvchenfeng/p/6794822.html 2.php中(服务器)使用CURL实现GET和P ...
- 安装nodejs nvm
安装nodejs sudo apt-get install nodejs sudo apt-get install npm 安装nvm https://www.runoob.com/w3cnote/n ...
- C++——extern
1.当它与"C"一起连用时,如: extern "C" void fun(int a, int b);则告诉编译器在编译fun这个函数名时按着C的规则去翻译相应 ...
- LightOJ 1203 Guarding Bananas (凸包最小顶角)
题目链接:LightOJ 1203 Problem Description Once there was a lazy monkey in a forest. But he loved banana ...
- Ubuntu12.04下删除文件夹内所有的.svn文件
前段时间在公司里遇到一个问题,从svn上下载下来的文件含有.svn文件,如何删除当前目录下的所有.svn文件呢? 一个个手动删除显然不可能,太多了.其实在Ubuntu12.04下延伸至其他所搜的Lin ...
- Nginx学习——location和rewrite
location语法: location [=|~|~*|^~] /uri/ { … } 记住以下即可: 完全匹配(=) 无正则普通匹配(^~)(^ 表示“非”,~ 表示“正则”,字符意思是:不要继续 ...
- 一份完整的 Java 成神路线图,值得收藏!
Java,是现阶段中国互联网公司中,覆盖度最广的研发语言. 有不少朋友问,如何深入学习Java后端技术栈,今天分享一个,互联网牛人整理出来的完整的Java成神路线图. 一:常见模式与工具 学习Java ...