vuejs / Discussion

Vue.js discussion
166 stars 17 forks source link

Passing Props -- Updating Parent Property Does Not Flow #1296

Open NearSingularity opened 7 years ago

NearSingularity commented 7 years ago

Trying to be as SSCCE as possible.

Issue:

I have a parent component that starts a small countdown in a setInterval and when that countdown hits 0 I set a parent property startTimer to true.

Pertinent Details

That parent property is bound to a child component like so :start='startTimer'.

Current Outcome

The parent property--startTimer does indeed change from false -> true but start is never updated on the child component.

[Edited]: Instead of a big block of code...here is a fiddle: https://jsfiddle.net/x5funm8k/10/

NearSingularity commented 7 years ago

Hastily closed this when I thought watch to be the sole answer.

[Edited]: watch is a solution to this issue...but still wondering why beforeUpdate doesn't get triggered in my original scenario...is this intended? Do I have a misconception on the purpose of beforeUpdate || updated and the child property binding flow?