2023-01-08 10:41:09 +02:00
|
|
|
<template>
|
2023-05-19 10:20:53 +03:00
|
|
|
<MkContainer :showHeader="widgetProps.showHeader" class="mkw-clicker">
|
2023-01-15 01:30:29 +02:00
|
|
|
<template #icon><i class="ti ti-cookie"></i></template>
|
|
|
|
<template #header>Clicker</template>
|
2023-01-08 10:41:09 +02:00
|
|
|
<MkClickerGame/>
|
|
|
|
</MkContainer>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-05-19 10:20:53 +03:00
|
|
|
import { useWidgetPropsManager, Widget, WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget';
|
2023-01-08 10:41:09 +02:00
|
|
|
import { GetFormResultType } from '@/scripts/form';
|
|
|
|
import MkContainer from '@/components/MkContainer.vue';
|
|
|
|
import MkClickerGame from '@/components/MkClickerGame.vue';
|
|
|
|
|
|
|
|
const name = 'clicker';
|
|
|
|
|
|
|
|
const widgetPropsDef = {
|
|
|
|
showHeader: {
|
|
|
|
type: 'boolean' as const,
|
2023-01-09 02:04:35 +02:00
|
|
|
default: false,
|
2023-01-08 10:41:09 +02:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
|
|
|
|
|
2023-05-19 10:20:53 +03:00
|
|
|
const props = defineProps<WidgetComponentProps<WidgetProps>>();
|
|
|
|
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
|
2023-07-08 01:08:16 +03:00
|
|
|
|
2023-01-08 10:41:09 +02:00
|
|
|
const { widgetProps, configure } = useWidgetPropsManager(name,
|
|
|
|
widgetPropsDef,
|
|
|
|
props,
|
|
|
|
emit,
|
|
|
|
);
|
|
|
|
|
|
|
|
defineExpose<WidgetComponentExpose>({
|
|
|
|
name,
|
|
|
|
configure,
|
|
|
|
id: props.widget ? props.widget.id : null,
|
|
|
|
});
|
|
|
|
</script>
|