From 7b7e80d2db11d8894dacc1834dd872cf53fdf817 Mon Sep 17 00:00:00 2001
From: Cagatay Civici Paginator can also be programmed programmatically using a binding to the first property that defines the index of the
first element to display. For example setting first to zero will reset the paginator to the very first page. This property
- also supports "sync" keyword in case you'd like your binding to be updated whenever the user changes the page.
<DataTable :value="cars" :paginator="true" :rows="10" :first="firstRecordIndex">
@@ -499,7 +499,7 @@ export default {
In case you'd like to display the table as sorted per a single column by default on mount or programmatically apply sort, use sortField and sortOrder properties. These - two properties also support the "sync" keyword to get updated when the user applies sort a column.
+ two properties also support the v-model directive to get updated when the user applies sort a column.
<DataTable :value="cars" sortField="year" :sortOrder="1">
@@ -619,7 +619,7 @@ methods: {
DataTable provides single and multiple selection modes on click of a row. Selected rows are bound to the selection property and updated using the sync keyword. +
DataTable provides single and multiple selection modes on click of a row. Selected rows are bound to the selection property and updated using the v-model directive. Alternatively column based selection can be done using radio buttons or checkboxes using selectionMode of a particular column. In addition row-select and row-unselect events are provided as optional callbacks.
@@ -629,7 +629,7 @@ methods: {
-<DataTable :value="cars" :selection.sync="selectedCar" selectionMode="single" dataKey="vin">
+<DataTable :value="cars" v-model:selection="selectedCar" selectionMode="single" dataKey="vin">
<Column field="vin" header="Vin"></Column>
<Column field="year" header="Year"></Column>
<Column field="brand" header="Brand"></Column>
@@ -641,7 +641,7 @@ methods: {
In multiple mode, selection binding should be an array and multiple items can either be selected using metaKey or toggled individually depending on the value of metaKeySelection property value which is true by default. On touch enabled devices metaKeySelection is turned off automatically. Additionally ShiftKey is supported for range selection.
-<DataTable :value="cars" :selection.sync="selectedCars" selectionMode="multiple" dataKey="vin">
+<DataTable :value="cars" v-model:selection="selectedCars" selectionMode="multiple" dataKey="vin">
<Column field="vin" header="Vin"></Column>
<Column field="year" header="Year"></Column>
<Column field="brand" header="Brand"></Column>
@@ -653,7 +653,7 @@ methods: {
If you prefer a radioButton or a checkbox instead of a row click, use the selectionMode of a column instead. Following datatable displays a checkbox at the first column of each row and automatically adds a header checkbox to toggle selection of all rows.
-<DataTable :value="cars" :selection.sync="selectedCars" selectionMode="multiple" dataKey="vin">
+<DataTable :value="cars" v-model:selection="selectedCars" selectionMode="multiple" dataKey="vin">
<Column selectionMode="multiple"></Column>
<Column field="vin" header="Vin"></Column>
<Column field="year" header="Year"></Column>
@@ -681,7 +681,7 @@ methods: {
<Button label="Show" icon="pi pi-external-link" @click="openDialog" />
-<Dialog header="Flex Scroll" :visible.sync="dialogVisible" :style="{width: '50vw'}" :maximizable="true" :modal="true" :contentStyle="{height: '300px'}">
+<Dialog header="Flex Scroll" v-model:visible="dialogVisible" :style="{width: '50vw'}" :maximizable="true" :modal="true" :contentStyle="{height: '300px'}">
<DataTable :value="cars" :scrollable="true" scrollHeight="flex">
<Column field="vin" header="Vin"></Column>
<Column field="year" header="Year"></Column>
@@ -913,12 +913,12 @@ export default {
Row Expansion
- Rows can be expanded to display additional content using the expandedRows property with the sync operator accompanied by a template named "expansion". row-expand and row-collapse are optional callbacks that are invoked when a row is expanded or toggled.
+ Rows can be expanded to display additional content using the expandedRows property with the v-model directive accompanied by a template named "expansion". row-expand and row-collapse are optional callbacks that are invoked when a row is expanded or toggled.
The dataKey property identifies a unique value of a row in the dataset, it is not mandatory in row expansion functionality however being able to define it increases the performance of the table signifantly.
-<DataTable :value="cars" :expandedRows.sync="expandedRows" dataKey="vin"
+<DataTable :value="cars" v-model:expandedRows="expandedRows" dataKey="vin"
@row-expand="onRowExpand" @row-collapse="onRowCollapse">
<template #header>
<div class="table-header-container">
@@ -1128,12 +1128,12 @@ export default {
- Row Editing is defined by setting cellEdit as "row", defining editingRows with the sync operator to hold the reference to the editing rows and adding a row editor column to provide the editing controls. Note that
+
Row Editing is defined by setting cellEdit as "row", defining editingRows with the v-model directive to hold the reference to the editing rows and adding a row editor column to provide the editing controls. Note that
since editingRows is two-way binding enabled, you may use it to initially display one or more rows in editing more or programmatically toggle row editing.
<h3>Row Editing</h3>
-<DataTable :value="cars" editMode="row" dataKey="vin" :editingRows.sync="editingRows"
+<DataTable :value="cars" editMode="row" dataKey="vin" v-model:editingRows="editingRows"
@row-edit-init="onRowEditInit" @row-edit-cancel="onRowEditCancel">
<Column field="vin" header="Vin"></Column>
<Column field="year" header="Year">
@@ -1300,7 +1300,7 @@ export default {
<h3>Expandable Row Groups</h3>
<DataTable :value="cars" rowGroupMode="subheader" groupRowsBy="brand"
sortMode="single" sortField="brand" :sortOrder="1"
- :expandableRowGroups="true" :expandedRowGroups.sync="expandedRowGroups"
+ :expandableRowGroups="true" v-model:expandedRowGroups="expandedRowGroups"
@rowgroup-expand="onRowExpand" @rowgroup-collapse="onRowCollapse">
<Column field="brand" header="Brand"></Column>
<Column field="vin" header="Vin"></Column>
@@ -1427,9 +1427,9 @@ export default {
-<DataTable :value="cars" :paginator="true" :rows="10" :filters.sync="filters"
+<DataTable :value="cars" :paginator="true" :rows="10" v-model:filters="filters"
stateStorage="session" stateKey="dt-state-demo-session"
- :selection.sync="selectedCar" selectionMode="single" dataKey="vin">
+ v-model:selection="selectedCar" selectionMode="single" dataKey="vin">
<template #header>
<div style="text-align: right">
<i class="pi pi-search" style="margin: 4px 4px 0px 0px;"></i>
@@ -1519,7 +1519,7 @@ export default {
DataTable provides exclusive integration with the ContextMenu component using, contextMenu, contextMenuSelection property along with the row-contextmenu event.
-<DataTable :value="cars" contextMenu :contextMenuSelection.sync="selectedCar" @row-contextmenu="onRowContextMenu">
+<DataTable :value="cars" contextMenu v-model:contextMenuSelection="selectedCar" @row-contextmenu="onRowContextMenu">
<Column field="vin" header="Vin"></Column>
<Column field="year" header="Year"></Column>
<Column field="brand" header="Brand"></Column>
@@ -2467,7 +2467,7 @@ export default {
<DataTable :value="customers" :paginator="true" class="p-datatable-customers" :rows="10"
- dataKey="id" :rowHover="true" :selection.sync="selectedCustomers" :filters="filters" :loading="loading"
+ dataKey="id" :rowHover="true" v-model:selection="selectedCustomers" :filters="filters" :loading="loading"
paginatorTemplate="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown" :rowsPerPageOptions="[10,25,50]"
currentPageReportTemplate="Showing {first} to {last} of {totalRecords} entries">
<template #header>
diff --git a/src/views/datatable/DataTableRowExpandDemo.vue b/src/views/datatable/DataTableRowExpandDemo.vue
index f7da575cc..915de5a89 100755
--- a/src/views/datatable/DataTableRowExpandDemo.vue
+++ b/src/views/datatable/DataTableRowExpandDemo.vue
@@ -74,7 +74,7 @@
-<DataTable :value="products" :expandedRows.sync="expandedRows" dataKey="id"
+<DataTable :value="products" v-model:expandedRows="expandedRows" dataKey="id"
@row-expand="onRowExpand" @row-collapse="onRowCollapse">
<template #header>
<div class="table-header-container">
diff --git a/src/views/datatable/DataTableRowGroupDemo.vue b/src/views/datatable/DataTableRowGroupDemo.vue
index e46bf9990..e6788e033 100755
--- a/src/views/datatable/DataTableRowGroupDemo.vue
+++ b/src/views/datatable/DataTableRowGroupDemo.vue
@@ -146,7 +146,7 @@
<p>Group customers by their representative.</p>
<DataTable :value="customers" rowGroupMode="subheader" groupRowsBy="representative.name"
sortMode="single" sortField="representative.name" :sortOrder="1"
- :expandableRowGroups="true" :expandedRowGroups.sync="expandedRowGroups"
+ :expandableRowGroups="true" v-model:expandedRowGroups="expandedRowGroups"
@rowgroup-expand="onRowGroupExpand" @rowgroup-collapse="onRowGroupCollapse">
<Column field="representative.name" header="Representative"></Column>
<Column field="name" header="Name"></Column>
diff --git a/src/views/datatable/DataTableScrollDemo.vue b/src/views/datatable/DataTableScrollDemo.vue
index a896d0905..8294cbe0d 100755
--- a/src/views/datatable/DataTableScrollDemo.vue
+++ b/src/views/datatable/DataTableScrollDemo.vue
@@ -131,7 +131,7 @@
<Button label="Show" icon="pi pi-external-link" @click="openDialog" />
</div>
-<Dialog header="Flex Scroll" :visible.sync="dialogVisible" :style="{width: '75vw'}" :maximizable="true" :modal="true" :contentStyle="{height: '300px'}">
+<Dialog header="Flex Scroll" v-model:visible="dialogVisible" :style="{width: '75vw'}" :maximizable="true" :modal="true" :contentStyle="{height: '300px'}">
<DataTable :value="customers" :scrollable="true" scrollHeight="flex">
<Column field="name" header="Name"></Column>
<Column field="country.name" header="Country"></Column>
diff --git a/src/views/datatable/DataTableStateDemo.vue b/src/views/datatable/DataTableStateDemo.vue
index 3e828c49f..6c4ab86d0 100755
--- a/src/views/datatable/DataTableStateDemo.vue
+++ b/src/views/datatable/DataTableStateDemo.vue
@@ -134,8 +134,8 @@
<div class="card">
<h5>Session Storage</h5>
- <DataTable :value="customers" :paginator="true" :rows="10" :filters.sync="filters1"
- :selection.sync="selectedCustomer1" selectionMode="single" dataKey="id"
+ <DataTable :value="customers" :paginator="true" :rows="10" v-model:filters="filters1"
+ v-model:selection="selectedCustomer1" selectionMode="single" dataKey="id"
stateStorage="session" stateKey="dt-state-demo-session">
<template #header>
<span class="p-input-icon-left">
@@ -193,8 +193,8 @@
<div class="card">
<h5>Local Storage</h5>
- <DataTable :value="customers" :paginator="true" :rows="10" :filters.sync="filters2"
- :selection.sync="selectedCustomer2" selectionMode="single" dataKey="id"
+ <DataTable :value="customers" :paginator="true" :rows="10" v-model:filters="filters2"
+ v-model:selection="selectedCustomer2" selectionMode="single" dataKey="id"
stateStorage="session" stateKey="dt-state-demo-local">
<template #header>
<span class="p-input-icon-left">
diff --git a/src/views/fieldset/FieldsetDoc.vue b/src/views/fieldset/FieldsetDoc.vue
index 2e2be3f41..ef2310957 100755
--- a/src/views/fieldset/FieldsetDoc.vue
+++ b/src/views/fieldset/FieldsetDoc.vue
@@ -58,11 +58,11 @@ import Fieldset from 'primevue/fieldset';
- Use the sync operator to enable two-way binding.
+ Use the v-model directive to enable two-way binding.
<button type="button" @click="isCollapsed = !isCollapsed">Toggle Programmatically</button>
-<Fieldset legend="Header Text" :toggleable="true" :collapsed.sync="isCollapsed">
+<Fieldset legend="Header Text" :toggleable="true" v-model:collapsed="isCollapsed">
Content
</Fieldset>
diff --git a/src/views/galleria/GalleriaAdvancedDemo.vue b/src/views/galleria/GalleriaAdvancedDemo.vue
index 4970dff8c..c8e86e622 100644
--- a/src/views/galleria/GalleriaAdvancedDemo.vue
+++ b/src/views/galleria/GalleriaAdvancedDemo.vue
@@ -40,7 +40,7 @@
-<Galleria ref="galleria" :value="images" :activeIndex.sync="activeIndex" :numVisible="5" style="max-width: 640px;" :class="galleriaClass"
+<Galleria ref="galleria" :value="images" v-model:activeIndex="activeIndex" :numVisible="5" style="max-width: 640px;" :class="galleriaClass"
:showThumbnails="showThumbnails" :showItemNavigators="true" :showItemNavigatorsOnHover="true"
:circular="true" :autoPlay="true" :transitionInterval="3000">
<template #item="slotProps">
diff --git a/src/views/galleria/GalleriaFullScreenDemo.vue b/src/views/galleria/GalleriaFullScreenDemo.vue
index de357449a..0cd5d3655 100755
--- a/src/views/galleria/GalleriaFullScreenDemo.vue
+++ b/src/views/galleria/GalleriaFullScreenDemo.vue
@@ -65,7 +65,7 @@
<h3>With Thumbnails</h3>
<Galleria :value="images" :responsiveOptions="responsiveOptions2" :numVisible="9" containerStyle="max-width: 50%"
- :circular="true" :fullScreen="true" :showItemNavigators="true" :visible.sync="displayBasic">
+ :circular="true" :fullScreen="true" :showItemNavigators="true" v-model:visible="displayBasic">
<template #item="slotProps">
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
</template>
@@ -78,7 +78,7 @@
<h3>Without Thumbnails</h3>
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="7" containerStyle="max-width: 850px"
- :circular="true" :fullScreen="true" :showItemNavigators="true" :showThumbnails="false" :visible.sync="displayBasic2">
+ :circular="true" :fullScreen="true" :showItemNavigators="true" :showThumbnails="false" v-model:visible="displayBasic2">
<template #item="slotProps">
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
</template>
@@ -90,8 +90,8 @@
<Button label="Show" icon="pi pi-external-link" @click="displayBasic2 = true" />
<h3>Custom Content</h3>
-<Galleria :value="images" :activeIndex.sync="activeIndex" :responsiveOptions="responsiveOptions" :numVisible="7" containerStyle="max-width: 850px"
- :circular="true" :fullScreen="true" :showItemNavigators="true" :showThumbnails="false" :visible.sync="displayCustom">
+<Galleria :value="images" v-model:activeIndex="activeIndex" :responsiveOptions="responsiveOptions" :numVisible="7" containerStyle="max-width: 850px"
+ :circular="true" :fullScreen="true" :showItemNavigators="true" :showThumbnails="false" v-model:visible="displayCustom">
<template #item="slotProps">
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
</template>
diff --git a/src/views/galleria/GalleriaProgrammaticDemo.vue b/src/views/galleria/GalleriaProgrammaticDemo.vue
index 761d19560..5cf8d9d47 100644
--- a/src/views/galleria/GalleriaProgrammaticDemo.vue
+++ b/src/views/galleria/GalleriaProgrammaticDemo.vue
@@ -35,7 +35,7 @@
<Button icon="pi pi-plus" @click="next" class="p-button-secondary" style="margin-left: .5rem" />
</div>
-<Galleria :value="images" :activeIndex.sync="activeIndex" :responsiveOptions="responsiveOptions" :numVisible="5" style="max-width: 640px">
+<Galleria :value="images" v-model:activeIndex="activeIndex" :responsiveOptions="responsiveOptions" :numVisible="5" style="max-width: 640px">
<template #item="slotProps">
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%" />
</template>
diff --git a/src/views/organizationchart/OrganizationChartDoc.vue b/src/views/organizationchart/OrganizationChartDoc.vue
index 25ad1fe50..236c027e2 100755
--- a/src/views/organizationchart/OrganizationChartDoc.vue
+++ b/src/views/organizationchart/OrganizationChartDoc.vue
@@ -191,11 +191,11 @@ export default {
Selection
- Selection is enabled by defining the selectionMode to either "single" or "multiple" and specifying the selectionKeys with the sync operator. Note that
+
Selection is enabled by defining the selectionMode to either "single" or "multiple" and specifying the selectionKeys with the v-model directive. Note that
selection on a particular node can be disabled if the selectable is false on the node instance.
- <OrganizationChart :value="data" selecionMode="single" :selectionKeys.sync="selectionKeys">
+ <OrganizationChart :value="data" selecionMode="single" v-model:selectionKeys="selectionKeys">
<template #default="slotProps">
<span>{{slotProps.node.data.label}}</span>
</template>
@@ -496,7 +496,7 @@ export default {
<h3>Advanced</h3>
-<OrganizationChart :value="data1" :collapsible="true" class="company" selectionMode="single" :selectionKeys.sync="selection"
+<OrganizationChart :value="data1" :collapsible="true" class="company" selectionMode="single" v-model:selectionKeys="selection"
@node-select="onNodeSelect" @node-unselect="onNodeUnselect" @node-collapse="onNodeCollapse" @node-expand="onNodeExpand">
<template #person="slotProps">
<div class="node-header ui-corner-top">{{slotProps.node.data.label}}</div>
diff --git a/src/views/overlaypanel/OverlayPanelDoc.vue b/src/views/overlaypanel/OverlayPanelDoc.vue
index 571826535..2b0b539b9 100755
--- a/src/views/overlaypanel/OverlayPanelDoc.vue
+++ b/src/views/overlaypanel/OverlayPanelDoc.vue
@@ -163,7 +163,7 @@ toggle(event) {
<Button type="button" icon="pi pi-search" :label="selectedProduct ? selectedProduct.name : 'Select a Product'" @click="toggle" aria:haspopup="true" aria-controls="overlay_panel" />
<OverlayPanel ref="op" appendTo="body" :showCloseIcon="true" id="overlay_panel" style="width: 450px">
- <DataTable :value="products" :selection.sync="selectedProduct" selectionMode="single" :paginator="true" :rows="5" @row-select="onProductSelect">
+ <DataTable :value="products" v-model:selection="selectedProduct" selectionMode="single" :paginator="true" :rows="5" @row-select="onProductSelect">
<Column field="name" header="Name" sortable></Column>
<Column header="Image">
<template #body="slotProps">
diff --git a/src/views/paginator/PaginatorDoc.vue b/src/views/paginator/PaginatorDoc.vue
index ebfb5d843..3810537c5 100755
--- a/src/views/paginator/PaginatorDoc.vue
+++ b/src/views/paginator/PaginatorDoc.vue
@@ -26,10 +26,10 @@ import Paginator from 'primevue/paginator';
- Use the sync operator to enable two-way binding, this is useful in cases where you need to programmatically control the paginator.
+ Use the v-model directive to enable two-way binding, this is useful in cases where you need to programmatically control the paginator.
-<Paginator :first.sync="offset" :rows="10" :totalRecords="totalItemsCount"></Paginator>
+<Paginator v-model:first="offset" :rows="10" :totalRecords="totalItemsCount"></Paginator>
@@ -37,15 +37,15 @@ import Paginator from 'primevue/paginator';
Number of items per page can be changed by the user using a dropdown with the rowsPerPageOptions property which accepts an array of possible values.
-<Paginator :first.sync="offset" :rows="rows" :totalRecords="totalItemsCount" :rowsPerPageOptions="[10,20,30]"></Paginator>
+<Paginator v-model:first="offset" :rows="rows" :totalRecords="totalItemsCount" :rowsPerPageOptions="[10,20,30]"></Paginator>
- As rows also change when the dropdown changes, use the optional sync operator if you need two-way binding.
+ As rows also change when the dropdown changes, use the optional v-model directive if you need two-way binding.
-<Paginator :first.sync="offset" :rows.sync="rows" :totalRecords="totalItemsCount" :rowsPerPageOptions="[10,20,30]"></Paginator>
+<Paginator v-model:first="offset" v-model:rows="rows" :totalRecords="totalItemsCount" :rowsPerPageOptions="[10,20,30]"></Paginator>
@@ -83,7 +83,7 @@ import Paginator from 'primevue/paginator';
-<Paginator :first.sync="offset" :rows="10" :totalRecords="totalItemsCount">
+<Paginator v-model:first="offset" :rows="10" :totalRecords="totalItemsCount">
<template #left="slotProps">
Page: {{slotProps.state.page}}
First: {{slotProps.state.first}}
@@ -266,7 +266,7 @@ onPage(event) {
<Paginator :rows="10" :totalRecords="totalRecords" :rowsPerPageOptions="[10,20,30]"></Paginator>
<h3>Custom</h3>
-<Paginator :first.sync="first" :rows="1" :totalRecords="totalRecords2"
+<Paginator v-model:first="first" :rows="1" :totalRecords="totalRecords2"
template="FirstPageLink PrevPageLink CurrentPageReport NextPageLink LastPageLink">
<template #left>
<Button type="button" icon="pi pi-refresh" @click="reset()"/>
diff --git a/src/views/panel/PanelDoc.vue b/src/views/panel/PanelDoc.vue
index 91b272b37..28d18c10e 100755
--- a/src/views/panel/PanelDoc.vue
+++ b/src/views/panel/PanelDoc.vue
@@ -57,12 +57,12 @@ import Panel from 'primevue/panel';
- Use the sync operator to enable two-way binding.
+ Use the v-model directive to enable two-way binding.
<button type="button" @click="isCollapsed = !isCollapsed">Toggle Programmatically</button>
-<Panel header="Header Text" :toggleable="true" :collapsed.sync="isCollapsed">
+<Panel header="Header Text" :toggleable="true" v-model:collapsed="isCollapsed">
Content
</Panel>
diff --git a/src/views/tabview/TabViewDoc.vue b/src/views/tabview/TabViewDoc.vue
index 0f0f2b0f1..be911d3f2 100755
--- a/src/views/tabview/TabViewDoc.vue
+++ b/src/views/tabview/TabViewDoc.vue
@@ -105,7 +105,7 @@ import TabPanel from 'primevue/tabpanel';
Programmatic Control
- Tabs can be controlled programmatically using active property that defines the active tab.
+ Tabs can be controlled programmatically using activeIndex property.
<Button @click="active = 0" class="p-button-text" label="Activate 1st" />
@@ -113,13 +113,13 @@ import TabPanel from 'primevue/tabpanel';
<Button @click="active = 2" class="p-button-text" label="Activate 3rd" />
<TabView v-model:activeIndex="active">
- <TabPanel header="Header I" :active.sync="active[0]">
+ <TabPanel header="Header I">
Content I
</TabPanel>
- <TabPanel header="Header II" :active.sync="active[1]">
+ <TabPanel header="Header II">
Content II
</TabPanel>
- <TabPanel header="Header III" :active.sync="active[2]">
+ <TabPanel header="Header III">
Content III
</TabPanel>
</TabView>
diff --git a/src/views/tree/TreeDoc.vue b/src/views/tree/TreeDoc.vue
index 94441fb01..d3f665629 100755
--- a/src/views/tree/TreeDoc.vue
+++ b/src/views/tree/TreeDoc.vue
@@ -192,7 +192,7 @@ export default class NodeService {
Programmatic Control
Tree state can be controlled programmatically with the expandedKeys property that defines the keys
- that are expanded. This property is a Map instance whose key is the key of a node and value is a boolean. Note that expandedKeys also supports two-way binding with the sync modifier.
+ that are expanded. This property is a Map instance whose key is the key of a node and value is a boolean. Note that expandedKeys also supports two-way binding with the v-model directive.
Example below expands and collapses all nodes with buttons.
@@ -276,7 +276,7 @@ export default {
Selection
- Tree supports single, multiple and checkbox selection modes. Define the selectionKeys with the sync operator and the selectionMode properties to enable the selection.
+
Tree supports single, multiple and checkbox selection modes. Define the selectionKeys with the v-model directive and the selectionMode properties to enable the selection.
By default in multiple selection mode, metaKey is necessary to add to existing selections however this can be configured with metaKeySelection property. Note that
in touch enabled devices, Tree does not require metaKey. In addition selection on a particular node can be disabled if the selectable is false on the node instance.
@@ -285,19 +285,19 @@ export default {
<h3>Single Selection</h3>
-<Tree :value="nodes" selectionMode="single" :selectionKeys.sync="selectedKey1"></Tree>
+<Tree :value="nodes" selectionMode="single" v-model:selectionKeys="selectedKey1"></Tree>
<h3>Multiple Selection with MetaKey</h3>
-<Tree :value="nodes" selectionMode="multiple" :selectionKeys.sync="selectedKeys1"></Tree>
+<Tree :value="nodes" selectionMode="multiple" v-model:selectionKeys="selectedKeys1"></Tree>
<h3>Multiple Selection without MetaKey</h3>
-<Tree :value="nodes" selectionMode="multiple" :selectionKeys.sync="selectedKeys2" :metaKeySelection="false"></Tree>
+<Tree :value="nodes" selectionMode="multiple" v-model:selectionKeys="selectedKeys2" :metaKeySelection="false"></Tree>
<h3>Checkbox Selection</h3>
-<Tree :value="nodes" selectionMode="checkbox" :selectionKeys.sync="selectedKeys3"></Tree>
+<Tree :value="nodes" selectionMode="checkbox" v-model:selectionKeys="selectedKeys3"></Tree>
<h3>Events</h3>
-<Tree :value="nodes" selectionMode="single" :selectionKeys.sync="selectedKey2" :metaKeySelection="false"
+<Tree :value="nodes" selectionMode="single" v-model:selectionKeys="selectedKey2" :metaKeySelection="false"
@node-select="onNodeSelect" @node-unselect="onNodeUnselect"></Tree>
diff --git a/src/views/tree/TreeSelectionDemo.vue b/src/views/tree/TreeSelectionDemo.vue
index 64306546a..68341312b 100755
--- a/src/views/tree/TreeSelectionDemo.vue
+++ b/src/views/tree/TreeSelectionDemo.vue
@@ -33,19 +33,19 @@
<h3>Single Selection</h3>
-<Tree :value="nodes" selectionMode="single" :selectionKeys.sync="selectedKey1"></Tree>
+<Tree :value="nodes" selectionMode="single" v-model:selectionKeys="selectedKey1"></Tree>
<h3>Multiple Selection with MetaKey</h3>
-<Tree :value="nodes" selectionMode="multiple" :selectionKeys.sync="selectedKeys1"></Tree>
+<Tree :value="nodes" selectionMode="multiple" v-model:selectionKeys="selectedKeys1"></Tree>
<h3>Multiple Selection without MetaKey</h3>
-<Tree :value="nodes" selectionMode="multiple" :selectionKeys.sync="selectedKeys2" :metaKeySelection="false"></Tree>
+<Tree :value="nodes" selectionMode="multiple" v-model:selectionKeys="selectedKeys2" :metaKeySelection="false"></Tree>
<h3>Checkbox Selection</h3>
-<Tree :value="nodes" selectionMode="checkbox" :selectionKeys.sync="selectedKeys3"></Tree>
+<Tree :value="nodes" selectionMode="checkbox" v-model:selectionKeys="selectedKeys3"></Tree>
<h3>Events</h3>
-<Tree :value="nodes" selectionMode="single" :selectionKeys.sync="selectedKey2" :metaKeySelection="false"
+<Tree :value="nodes" selectionMode="single" v-model:selectionKeys="selectedKey2" :metaKeySelection="false"
@node-select="onNodeSelect" @node-unselect="onNodeUnselect"></Tree>
diff --git a/src/views/treetable/TreeTableDoc.vue b/src/views/treetable/TreeTableDoc.vue
index 278b809ee..b9529ce19 100755
--- a/src/views/treetable/TreeTableDoc.vue
+++ b/src/views/treetable/TreeTableDoc.vue
@@ -633,7 +633,7 @@ export default {
Programmatic Control
Tree state can be controlled programmatically with the expandedKeys property that defines the keys
- that are expanded. This property is a Map instance whose key is the key of a node and value is a boolean. Note that expandedKeys also supports two-way binding with the sync modifier.
+ that are expanded. This property is a Map instance whose key is the key of a node and value is a boolean. Note that expandedKeys also supports two-way binding with the v-model directive.
Example below expands and collapses all nodes with buttons.
@@ -821,7 +821,7 @@ export default {
Paginator can also be programmed programmatically using a binding to the first property that defines the index of the
first element to display. For example setting first to zero will reset the paginator to the very first page. This property
- also supports "sync" keyword in case you'd like your binding to be updated whenever the user changes the page.
+ also supports the v-model directive in case you'd like your binding to be updated whenever the user changes the page.
<TreeTable :value="nodes" :paginator="true" :rows="10" :first="firstRecordIndex">
@@ -858,7 +858,7 @@ export default {
In case you'd like to display the table as sorted per a single column by default on mount or programmatically apply sort, use sortField and sortOrder properties. These
- two properties also support the "sync" keyword to get updated when the user applies sort a column.
+ two properties also support the v-model directive to get updated when the user applies sort a column.
<TreeTable :value="nodes" sortField="size" :sortOrder="1"">
@@ -959,7 +959,7 @@ export default {
Selection
- Tree supports single, multiple and checkbox selection modes. Define the selectionKeys with the sync operator and the selectionMode properties to enable the selection.
+
Tree supports single, multiple and checkbox selection modes. Define the selectionKeys with the v-model operator and the selectionMode properties to enable the selection.
By default in multiple selection mode, metaKey is necessary to add to existing selections however this can be configured with metaKeySelection property. Note that
in touch enabled devices, Tree does not require metaKey. In addition selection on a particular node can be disabled if the selectable is false on the node instance.
@@ -967,28 +967,28 @@ export default {
in "checkbox" mode, instead of a boolean, value should be an object that has "checked" and "partialChecked" properties to represent the checked state of a node.
-<TreeTable :value="nodes" selectionMode="multiple" :selectionKeys.sync="selectedKeys1">
+<TreeTable :value="nodes" selectionMode="multiple" v-model:selectionKeys="selectedKeys1">
<Column field="name" header="Name" :expander="true"></Column>
<Column field="size" header="Size"></Column>
<Column field="type" header="Type"></Column>
</TreeTable>
<h3>Multiple Selection without MetaKey</h3>
-<TreeTable :value="nodes" selectionMode="multiple" :selectionKeys.sync="selectedKeys2" :metaKeySelection="false">
+<TreeTable :value="nodes" selectionMode="multiple" v-model:selectionKeys="selectedKeys2" :metaKeySelection="false">
<Column field="name" header="Name" :expander="true"></Column>
<Column field="size" header="Size"></Column>
<Column field="type" header="Type"></Column>
</TreeTable>
<h3>Checkbox Selection</h3>
-<TreeTable :value="nodes" selectionMode="checkbox" :selectionKeys.sync="selectedKeys3">
+<TreeTable :value="nodes" selectionMode="checkbox" v-model:selectionKeys="selectedKeys3">
<Column field="name" header="Name" :expander="true"></Column>
<Column field="size" header="Size"></Column>
<Column field="type" header="Type"></Column>
</TreeTable>
<h3>Events</h3>
-<TreeTable :value="nodes" selectionMode="single" :selectionKeys.sync="selectedKey2"
+<TreeTable :value="nodes" selectionMode="single" v-model:selectionKeys="selectedKey2"
@node-select="onNodeSelect" @node-unselect="onNodeUnselect">
<Column field="name" header="Name" :expander="true"></Column>
<Column field="size" header="Size"></Column>
diff --git a/src/views/treetable/TreeTableSelectionDemo.vue b/src/views/treetable/TreeTableSelectionDemo.vue
index c3283646d..b2fe7834b 100755
--- a/src/views/treetable/TreeTableSelectionDemo.vue
+++ b/src/views/treetable/TreeTableSelectionDemo.vue
@@ -61,35 +61,35 @@
<h3>Single Selection</h3>
-<TreeTable :value="nodes" selectionMode="single" :selectionKeys.sync="selectedKey1">
+<TreeTable :value="nodes" selectionMode="single" v-model:selectionKeys="selectedKey1">
<Column field="name" header="Name" :expander="true"></Column>
<Column field="size" header="Size"></Column>
<Column field="type" header="Type"></Column>
</TreeTable>
<h3>Multiple Selection with MetaKey</h3>
-<TreeTable :value="nodes" selectionMode="multiple" :selectionKeys.sync="selectedKeys1">
+<TreeTable :value="nodes" selectionMode="multiple" v-model:selectionKeys="selectedKeys1">
<Column field="name" header="Name" :expander="true"></Column>
<Column field="size" header="Size"></Column>
<Column field="type" header="Type"></Column>
</TreeTable>
<h3>Multiple Selection without MetaKey</h3>
-<TreeTable :value="nodes" selectionMode="multiple" :selectionKeys.sync="selectedKeys2" :metaKeySelection="false">
+<TreeTable :value="nodes" selectionMode="multiple" v-model:selectionKeys="selectedKeys2" :metaKeySelection="false">
<Column field="name" header="Name" :expander="true"></Column>
<Column field="size" header="Size"></Column>
<Column field="type" header="Type"></Column>
</TreeTable>
<h3>Checkbox Selection</h3>
-<TreeTable :value="nodes" selectionMode="checkbox" :selectionKeys.sync="selectedKeys3">
+<TreeTable :value="nodes" selectionMode="checkbox" v-model:selectionKeys="selectedKeys3">
<Column field="name" header="Name" :expander="true"></Column>
<Column field="size" header="Size"></Column>
<Column field="type" header="Type"></Column>
</TreeTable>
<h3>Events</h3>
-<TreeTable :value="nodes" selectionMode="single" :selectionKeys.sync="selectedKey2"
+<TreeTable :value="nodes" selectionMode="single" v-model:selectionKeys="selectedKey2"
@node-select="onNodeSelect" @node-unselect="onNodeUnselect">
<Column field="name" header="Name" :expander="true"></Column>
<Column field="size" header="Size"></Column>