dragonroll/documentation/docs/window.md
BinarySandia04 6b558b2e3d
All checks were successful
test / run-tests-client (push) Successful in 20s
test / run-tests-backend (push) Successful in 16s
Better docs
2024-10-11 12:50:46 +02:00

47 lines
919 B
Markdown

## Template
This template will help you get started with your first window, it contains the bare
minimum for creating a Dragonroll window.
```js
<script setup>
import { onMounted, ref } from 'vue';
import { SetupHandle, SetSize, ResetPosition } from '@/services/Windows';
import WindowHandle from '@/views/partials/WindowHandle.vue';
const handle = ref(null);
const props = defineProps(['data']);
const data = props.data;
let id = data.id;
const test = ref(null)
onMounted(() => {
SetupHandle(id, handle);
SetSize(id, {width: 500, height: 380});
ResetPosition(id, "center");
});
</script>
<template>
<div class="window-wrapper" :id="'window-wrapper-' + id">
<WindowHandle :window="id" ref="handle"></WindowHandle>
<!-- Body -->
<div ref="test"></div>
</div>
</template>
<style scoped>
.window-wrapper {
display: flex;
align-items: center;
}
</style>
```