elementUI 使用el-date-picker 表单组件报错Avoid mutating a prop directly since the value will be overwritten whenever

Avoid mutating a prop directly since the value will be overwritten whenever

使用elementUI时自己封装了个子 组件 el-time-select / el-date-picker /el-date-picker 时报错

([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: "placement")

但是仅仅是控制台报错,系统能正常运行,有强迫症的我打算修复好它

百度了一下,说什么子组件改变了prop的值,但是我并没有改变prop的值

经过一系列查询最终发现和elementUI版本有关

目前亲测可用版本为  2.15.6 注意前面不要加 ^ 符号

科普小知识

指定版本号
(1)指定版本:比如"vue": "2.15.2",表示指定安装2.15.2的版本

(2)波浪号~ 指定版本:比如 "vue": "~2.15.2",表示安装2.5.x的最新版本(不低于2.15.2),但是不安装2.16.x,也就是说安装时不改变大版本号和次要版本号

(3)^ 指定版本:比如 "vue": "^2.15.2" ,表示安装2.5.2及以上的版本,但是不安装3.0.0,也就是说安装时不改变大版本号。

 

posted @   三线码工  阅读(7208)  评论(2编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· Obsidian + DeepSeek:免费 AI 助力你的知识管理,让你的笔记飞起来!
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· Windows 提权-UAC 绕过
点击右上角即可分享
微信分享提示