fix(sql-prettifier): better responsiveness

This commit is contained in:
Corentin Thomasset 2022-07-24 15:54:05 +02:00
parent 328fda65b3
commit 560fcf3f78
No known key found for this signature in database
GPG key ID: DBD997E935996158

View file

@ -1,9 +1,7 @@
<template>
<div style="flex: 0 0 100%">
<div style="margin: 0 auto; width: 600px">
<n-space n-space item-style="flex: 1 1 0">
<div>
<n-form-item label="Dialect">
<n-space item-style="flex:1 1 0" style="margin: 0 auto; max-width: 600px" :vertical="styleStore.isSmallScreen">
<n-form-item label="Dialect" label-width="500">
<n-select
v-model:value="config.language"
:options="[
@ -23,8 +21,6 @@
]"
/>
</n-form-item>
</div>
<div>
<n-form-item label="Keyword case">
<n-select
v-model:value="config.keywordCase"
@ -35,8 +31,6 @@
]"
/>
</n-form-item>
</div>
<div>
<n-form-item label="Indent style">
<n-select
v-model:value="config.indentStyle"
@ -47,10 +41,8 @@
]"
/>
</n-form-item>
</div>
</n-space>
</div>
</div>
<n-form-item label="Your SQL query">
<n-input
@ -77,6 +69,7 @@
<script setup lang="ts">
import { useCopy } from '@/composable/copy';
import { useStyleStore } from '@/stores/style.store';
import { useElementSize } from '@vueuse/core';
import hljs from 'highlight.js/lib/core';
import sqlHljs from 'highlight.js/lib/languages/sql';
@ -86,7 +79,7 @@ hljs.registerLanguage('sql', sqlHljs);
const inputElement = ref<HTMLElement>();
const { height: inputElementHeight } = useElementSize(inputElement);
const styleStore = useStyleStore();
const config = reactive<Partial<FormatFnOptions>>({
keywordCase: 'upper',
useTabs: false,