mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Create missing Cell.vue missing in web UI widgets back
This commit is contained in:
parent
e0574b8ded
commit
3115439023
1 changed files with 50 additions and 0 deletions
50
src/ui/client/dashboard/components/Widget/Cell.vue
Normal file
50
src/ui/client/dashboard/components/Widget/Cell.vue
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<script setup>
|
||||
import { reactive, computed, ref, onMounted, watch } from "vue";
|
||||
import Text from "@components/Widget/Text.vue";
|
||||
import Icons from "@components/Widget/Icons.vue";
|
||||
import Fields from "@components/Form/Fields.vue";
|
||||
import Button from "@components/Widget/Button.vue";
|
||||
import ButtonGroup from "@components/Widget/ButtonGroup.vue";
|
||||
import { useEqualStr } from "@utils/global.js";
|
||||
/**
|
||||
* @name Builder/Cell.vue
|
||||
* @description This component includes all elements that can be shown in a table cell.
|
||||
* @example
|
||||
* {
|
||||
* type : "button",
|
||||
* data : {
|
||||
* id: "open-modal-btn",
|
||||
* text: "Open modal",
|
||||
* disabled: false,
|
||||
* hideText: true,
|
||||
* color: "green",
|
||||
* size: "normal",
|
||||
* iconName: "modal",
|
||||
* attrs: { data-toggle: "modal", "data-target": "#modal"},
|
||||
* }
|
||||
* }
|
||||
* @param {String} type - The type of the cell. This needs to be a Vue component.
|
||||
* @param {Object} data - The data to display in the cell. This needs to be the props of the Vue component.
|
||||
*/
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Text v-if="useEqualStr(props.type, 'Text')" v-bind="props.data" />
|
||||
<Icons v-if="useEqualStr(props.type, 'Icons')" v-bind="props.data" />
|
||||
<Fields v-if="useEqualStr(props.type, 'Fields')" v-bind="props.data" />
|
||||
<Button v-if="useEqualStr(props.type, 'Button')" v-bind="props.data" />
|
||||
<ButtonGroup
|
||||
v-if="useEqualStr(props.type, 'ButtonGroup')"
|
||||
v-bind="props.data"
|
||||
/>
|
||||
</template>
|
||||
Loading…
Reference in a new issue