You've already forked obsidian-visualiser
Rollback CharacterEditor to the previous version
This commit is contained in:
28
app/pages/character/[id]/edit.client.vue
Normal file
28
app/pages/character/[id]/edit.client.vue
Normal file
@@ -0,0 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
import { CharacterBuilder } from '~~/shared/character';
|
||||
import { unifySlug } from '~~/shared/general';
|
||||
|
||||
definePageMeta({
|
||||
requiresAuth: true,
|
||||
validState: true,
|
||||
});
|
||||
const id = unifySlug(useRouter().currentRoute.value.params.id ?? "new");
|
||||
const container = useTemplateRef('container');
|
||||
|
||||
onMounted(() => {
|
||||
queueMicrotask(() => {
|
||||
if(container.value)
|
||||
{
|
||||
const builder = new CharacterBuilder(container.value, id === 'new' ? undefined : id);
|
||||
|
||||
useShortcuts({
|
||||
"Meta_S": () => builder.save(false),
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-1 max-w-full flex-col align-center" ref="container"></div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user