배경 : AlertDialog가 create되고, 우리가 설정한 timeout이 지나서 destroy되기 전에 dialog overlay를 클릭하면 발생하는 에러
[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: "dialog"
원인 : NavBar(parent)로부터 AlertDialog(child)로 넘겨받은 props 중 "dialog"가 있다. : timeout이 지나기 전, dialog overlay를 클릭하면 이 "dialog" false로 만드는데, : parent로부터 받은 props를 child에서 변경하면서 발생하는 에러
Parent에서 child로 Number 타입의 "params" props를 넘기고 싶다면
// Childprops: {
params: {
type: Number
}
}
// Parent
<parent :params="5000" />
// params="5000" 와 같이 넘기면 String 타입으로 에러 발생
2편 예고 : Vue Global Alert Component 제작기(2)
: 부모에게 대드는 자식을 잡아보자.
AlertDialog가 create되고, 우리가 설정한 timeout이 지나서 destroy되기 전에 dialog overlay를 클릭하면 발생하는 에러
[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: "dialog"