We have a component in Vue which is a frame, scaled to the window size, which contains (in a <slot>
) an element (typically <img>
or <canvas>
) which it scales to fit the frame and enables pan and zoom on that element.
The component needs to react when the element changes. The only way we can see to do it is for the parent to prod the component when that happens, however it would be much nicer if the component could automatically detect when the <slot>
element changes and react accordingly. Is there a way to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…