antoniandre / splitpanes

A Vue 3 (and 2) reliable, simple and touch-ready panes splitter / resizer.
https://antoniandre.github.io/splitpanes
MIT License
1.91k stars 171 forks source link

Reactive prop update within child component #37

Closed calebeaires closed 5 years ago

calebeaires commented 5 years ago

Props within a child component are not being updated even if using watch-slots. Here is how I am using splitpane:

<template>
    <div>

       <!-- child component without splitpanes -->
       <!-- text value is updated -->
      <hello  :text="text" />

       <!-- child component into a splitpanes block -->
       <!-- using watch-slots -->
       <!-- text value is NOT updated -->
      <splitpanes watch-slots>
           <hello :text="text" />
      </splitpanes>

       <!-- extra: -->
       <!-- using watch-slots, here it works -->
       <!-- text value is updated -->
      <splitpanes watch-slots>
           {{text}}
      </splitpanes>

    </div>
</template>

Vue script code:

...
data(){
  return { text: "Hello split" }
}

mounted(){
    setTimeout(() => {
       this.$data.text = "Ok, I am a new text"
    }, 3000);

}
antoniandre commented 5 years ago

Thank you for your feedbacks. Please continue discussion and watch changes in #47.