From 6e12f5d3e99091925b84c206c3a878c793b3c5ef Mon Sep 17 00:00:00 2001 From: xiaoluoboding Date: Mon, 25 Nov 2019 13:41:44 +0800 Subject: [PATCH] feat: add static property on smart-widget-grid --- README.md | 5 ++++- app/views/WidgetWithGrid.vue | 3 +++ src/packages/SmartWidget.vue | 5 ++--- src/packages/SmartWidgetGrid.vue | 16 ++++++++-------- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b6f086a..e970c39 100644 --- a/README.md +++ b/README.md @@ -124,12 +124,14 @@ new Vue({ | Name | Description | Parameters | |:--------:|--------|:--------| -| on-refresh | Used when the widget need fetching data from ajax methods, usually used with `loading` attribute | - | | move | Every time an item is being moved and changes position | `(i, newX, newY)` | | moved | Every time an item is finished being moved and changes position | `(i, newX, newY)` | | resize | Every time an item is being resized and changes size | `(i, newH, newW, newHPx, newWPx)` | | resized | Every time an item is finished being moved and changes position | `(i, newH, newW, newHPx, newWPx)` | | container-resized | Every time the grid item/layout container changes size (browser window or other) | `(i, newH, newW, newHPx, newWPx)` | +| on-refresh | Used when the widget need fetching data from ajax methods, usually used with `loading` attribute | - | +| before-fullscreen | Used when the widget before fullscreen, usually used with `fullscreen` attribute | `true` or `false` | +| on-fullscreen | Used when the widget is already fullscreen, usually used with `fullscreen` attribute | `true` or `false` | ## CSS Selector in SmartWidget @@ -150,6 +152,7 @@ new Vue({ | margin | Says what are the margins of elements inside the grid. | Array | - | `[10, 10]` | | isDraggable | Says if the grids items are draggable. | Boolean | `true` or `false` | `true` | | isResizable | Says if the grids items are resizable. | Boolean | `true` or `false` | `true` | +| static | control all widgets won't be draggable, resizable or moved | Boolean | `true` or `false` | `false` | ## Slot scopes diff --git a/app/views/WidgetWithGrid.vue b/app/views/WidgetWithGrid.vue index 8e04d6f..cbc29da 100644 --- a/app/views/WidgetWithGrid.vue +++ b/app/views/WidgetWithGrid.vue @@ -3,6 +3,7 @@ :layout="layout" :row-height="48" :margin="[15, 15]" + :is-static="isStatic" @layout-updated="onLayoutUpdated" @move="onMove" @container-resized="onContainerResized"> @@ -49,6 +50,7 @@ refresh is-actived :loading="loading" + @before-fullscreen="val => isStatic = val" @on-refresh="handleRefresh">