PanJiaChen / vue-split-pane

Split-Pane component built with vue2.0, can be split vertically or horizontally. http://panjiachen.github.io/split-pane/demo/index.html
557 stars 104 forks source link

resize is not defined #23

Open gg4u opened 4 years ago

gg4u commented 4 years ago

I got this error:

Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

I imported like this: import splitPane from 'vue-splitpane';

 components : {
    ..
    splitPane : splitPane
    ...
  },

and making use of this template:

<split-pane v-on:resize="resize" :min-percent='20' :default-percent='30' split="vertical">
      <template slot="paneL">
        A
      </template>
      <template slot="paneR">
        B
      </template>
    </split-pane>

Please advise

JoeSziveri commented 3 years ago

v-on:resize is the callback function when the pane is resized. In this example, the resize function is named "resize". You need to create this function in your methods if you wish to use it.