feat: add options data

This commit is contained in:
Qiuxia Fan
2021-12-24 16:53:58 +08:00
parent 7627a8a15c
commit f3e7b56d56
5 changed files with 48 additions and 35 deletions

View File

@@ -15,7 +15,7 @@ limitations under the License. -->
<template>
<grid-layout
v-model:layout="dashboardStore.layout"
:col-num="12"
:col-num="24"
:row-height="10"
:is-draggable="true"
:is-resizable="true"
@@ -36,11 +36,11 @@ limitations under the License. -->
</template>
<script lang="ts" setup>
import { useDashboardStore } from "@/store/modules/dashboard";
import { GridItemData } from "@/types/dashboard";
import { LayoutConfig } from "@/types/dashboard";
import Widget from "./Widget.vue";
const dashboardStore = useDashboardStore();
function layoutUpdatedEvent(newLayout: GridItemData) {
function layoutUpdatedEvent(newLayout: LayoutConfig) {
dashboardStore.setLayout(newLayout);
}
</script>

View File

@@ -32,11 +32,11 @@ limitations under the License. -->
<script lang="ts" setup>
import { defineProps } from "vue";
import type { PropType } from "vue";
import { GridItemData } from "@/types/dashboard";
import { LayoutConfig } from "@/types/dashboard";
import { useDashboardStore } from "@/store/modules/dashboard";
const props = defineProps({
item: { type: Object as PropType<GridItemData> },
item: { type: Object as PropType<LayoutConfig> },
});
const dashboardStore = useDashboardStore();
function removeWidget() {