ElemeFE / ElemeFE/element

[Bug Report] [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"

Open
#21,941 26 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
54k
Forks
14.4k
PR merge metrics
No merged PRs in 30d

Description

### Element UI version
2.15.9

### OS/Browsers version
Chrome/102

### Vue version
2.6.14

### Reproduction Link
https://github.com/ElemeFE/element/commit/807e20845ec060655bb7b17588e6c58dd06257c5

### Steps to reproduce
只要用date-picker这个组件就会报Vue warn
原因就是在packages/date-picker/src/picker.vue这个文件第583行this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left;修改了这个变量,但是第101行把placement 添加到props属性里面去了

### What is Expected?
不要报Vue warn

### What is actually happening?
vue.runtime.esm.js?c320:619 [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"

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.