欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

vue.runtime.esm.js:619 [Vue warn]: Avoid mutating a prop directly since the value will be overwritte

最编程 2024-07-28 07:34:40
...
<template> <el-dialog title="XXXX" :visible.sync="IsShowPage" /> </template> <script> export default { name: 'NoteBookLimitFlow', props: { isVisible: { type: Boolean, default() { return false } } }, data() { return { // 定义一个IsShowPage来接收传递过来的值 IsShowPage: this.isVisible } }, watch: { isVisible(val) { this.IsShowPage = val// 新增isVisible的watch,监听变更并同步到IsShowPage上 } } } </script>