Two way binding support to Fieldset
parent
5f85149b6c
commit
5144c41bf3
|
@ -36,6 +36,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
toggle(event) {
|
toggle(event) {
|
||||||
this.d_collapsed = !this.d_collapsed;
|
this.d_collapsed = !this.d_collapsed;
|
||||||
|
this.$emit('update:collapsed', this.d_collapsed);
|
||||||
this.$emit('toggle', {
|
this.$emit('toggle', {
|
||||||
originalEvent: event,
|
originalEvent: event,
|
||||||
value: this.d_collapsed
|
value: this.d_collapsed
|
||||||
|
|
|
@ -39,6 +39,21 @@ import Fieldset from 'primevue/fieldset';
|
||||||
Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family,
|
Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family,
|
||||||
kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.
|
kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.
|
||||||
</Fieldset>
|
</Fieldset>
|
||||||
|
</CodeHighlight>
|
||||||
|
|
||||||
|
<p>To control the initial state of the toggleable panel, use the <i>collapsed</i> property.</p>
|
||||||
|
<CodeHighlight>
|
||||||
|
<Fieldset legend="Header Text" :toggleable="true" :collapsed="true">
|
||||||
|
Content
|
||||||
|
</Fieldset>
|
||||||
|
</CodeHighlight>
|
||||||
|
|
||||||
|
<p>Use the sync operator to enable two-way binding.</p>
|
||||||
|
<CodeHighlight>
|
||||||
|
<button type="button" @click="isCollapsed = !isCollapsed">Toggle Programmatically</button>
|
||||||
|
<Fieldset legend="Header Text" :toggleable="true" :collapsed.sync="isCollapsed">
|
||||||
|
Content
|
||||||
|
</Fieldset>
|
||||||
</CodeHighlight>
|
</CodeHighlight>
|
||||||
|
|
||||||
<h3>Properties</h3>
|
<h3>Properties</h3>
|
||||||
|
|
Loading…
Reference in New Issue