26 lines
444 B
JavaScript
26 lines
444 B
JavaScript
|
Vue.component('toggle-pane',{
|
|||
|
props: {
|
|||
|
visible: {
|
|||
|
type: Boolean,
|
|||
|
default: false
|
|||
|
},
|
|||
|
label: String,
|
|||
|
class: String,
|
|||
|
},
|
|||
|
data: function(){
|
|||
|
return {
|
|||
|
};
|
|||
|
},
|
|||
|
template: `
|
|||
|
<div class="toggle-pane">
|
|||
|
<button
|
|||
|
@click="visible = !visible"
|
|||
|
>{{ label }}</button>
|
|||
|
<div
|
|||
|
v-if="visible"
|
|||
|
><slot></slot>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
`,
|
|||
|
});
|