From c89d6879b32fde7dbc436a5fa16db7740edbe31a Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Wed, 1 Jul 2020 18:54:09 +0300 Subject: [PATCH] Update OverlayPanel Demo --- .../datatable/DataTableTemplatingDemo.vue | 2 - src/views/overlaypanel/OverlayPanelDemo.vue | 54 +++++++++++++++++-- src/views/overlaypanel/OverlayPanelDoc.vue | 50 ++++++++++++++--- 3 files changed, 91 insertions(+), 15 deletions(-) diff --git a/src/views/datatable/DataTableTemplatingDemo.vue b/src/views/datatable/DataTableTemplatingDemo.vue index 24778c195..ca2be3730 100755 --- a/src/views/datatable/DataTableTemplatingDemo.vue +++ b/src/views/datatable/DataTableTemplatingDemo.vue @@ -43,8 +43,6 @@ - -
diff --git a/src/views/overlaypanel/OverlayPanelDemo.vue b/src/views/overlaypanel/OverlayPanelDemo.vue index 63272ce82..985617ddc 100755 --- a/src/views/overlaypanel/OverlayPanelDemo.vue +++ b/src/views/overlaypanel/OverlayPanelDemo.vue @@ -3,16 +3,28 @@

OverlayPanel

-

OverlayPanel is a container component that can overlay other components on page.

+

OverlayPanel is a container component positioned as connected to its target.

-
@@ -22,16 +34,48 @@ \ No newline at end of file + + + \ No newline at end of file diff --git a/src/views/overlaypanel/OverlayPanelDoc.vue b/src/views/overlaypanel/OverlayPanelDoc.vue index 517578fd7..972374f36 100755 --- a/src/views/overlaypanel/OverlayPanelDoc.vue +++ b/src/views/overlaypanel/OverlayPanelDoc.vue @@ -152,21 +152,55 @@ toggle(event) { +import ProductService from '../../service/ProductService'; + export default { - methods: { - toggle(event) { - this.$refs.op.toggle(event); - } - } + data() { + return { + products: null, + selectedProduct: null + } + }, + productService: null, + created() { + this.productService = new ProductService(); + }, + mounted() { + this.productService.getProductsSmall().then(data => this.products = data); + }, + methods: { + toggle(event) { + this.$refs.op.toggle(event); + }, + formatCurrency(value) { + return value.toLocaleString('en-US', {style: 'currency', currency: 'USD'}); + }, + onProductSelect(event) { + this.$refs.op.hide(); + this.$toast.add({severity:'info', summary: 'Product Select', detail: event.data.name, life: 3000}); + } + } }