[Bug Report] use a data or computed property based on the prop's value. placement 是prop vue不让直接在子组件里面直接修改placement
- 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
### Vue version
2.6.10
### Reproduction Link
https://github.com/
### Steps to reproduce
const NewPopper = {
props: {
appendToBody: Popper.props.appendToBody,
offset: Popper.props.offset,
boundariesPadding: Popper.props.boundariesPadding,
arrowOffset: Popper.props.arrowOffset,
placement: Popper.props.placement,
transformOrigin: Popper.props.transformOrigin
},
methods: Popper.methods,
data() {
return merge({ visibleArrow: true }, Popper.data);
},
beforeDestroy: Popper.beforeDestroy
};
created() {
// vue-popper
this.popperOptions = {
boundariesPadding: 0,
gpuAcceleration: false
};
this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left;
this.$on('fieldReset', this.handleFieldReset);
},
this.placement 是prop,vue报错警告
### What is Expected?
修复报错
### What is actually happening?
???
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the NewPopper prop declaration and the created hook shown in the reproduction steps, then reproduce the Vue warning using the provided steps. Determine how placement is being assigned after it is declared as a prop; done means the warning is gone and the component still uses the intended placement value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100