mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-22 07:46:15 -04:00
fix(sql-prettifier): better responsiveness
This commit is contained in:
parent
328fda65b3
commit
560fcf3f78
1 changed files with 44 additions and 51 deletions
|
@ -1,9 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="flex: 0 0 100%">
|
<div style="flex: 0 0 100%">
|
||||||
<div style="margin: 0 auto; width: 600px">
|
<n-space item-style="flex:1 1 0" style="margin: 0 auto; max-width: 600px" :vertical="styleStore.isSmallScreen">
|
||||||
<n-space n-space item-style="flex: 1 1 0">
|
<n-form-item label="Dialect" label-width="500">
|
||||||
<div>
|
|
||||||
<n-form-item label="Dialect">
|
|
||||||
<n-select
|
<n-select
|
||||||
v-model:value="config.language"
|
v-model:value="config.language"
|
||||||
:options="[
|
:options="[
|
||||||
|
@ -23,8 +21,6 @@
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<n-form-item label="Keyword case">
|
<n-form-item label="Keyword case">
|
||||||
<n-select
|
<n-select
|
||||||
v-model:value="config.keywordCase"
|
v-model:value="config.keywordCase"
|
||||||
|
@ -35,8 +31,6 @@
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<n-form-item label="Indent style">
|
<n-form-item label="Indent style">
|
||||||
<n-select
|
<n-select
|
||||||
v-model:value="config.indentStyle"
|
v-model:value="config.indentStyle"
|
||||||
|
@ -47,10 +41,8 @@
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
</div>
|
|
||||||
</n-space>
|
</n-space>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<n-form-item label="Your SQL query">
|
<n-form-item label="Your SQL query">
|
||||||
<n-input
|
<n-input
|
||||||
|
@ -77,6 +69,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useCopy } from '@/composable/copy';
|
import { useCopy } from '@/composable/copy';
|
||||||
|
import { useStyleStore } from '@/stores/style.store';
|
||||||
import { useElementSize } from '@vueuse/core';
|
import { useElementSize } from '@vueuse/core';
|
||||||
import hljs from 'highlight.js/lib/core';
|
import hljs from 'highlight.js/lib/core';
|
||||||
import sqlHljs from 'highlight.js/lib/languages/sql';
|
import sqlHljs from 'highlight.js/lib/languages/sql';
|
||||||
|
@ -86,7 +79,7 @@ hljs.registerLanguage('sql', sqlHljs);
|
||||||
|
|
||||||
const inputElement = ref<HTMLElement>();
|
const inputElement = ref<HTMLElement>();
|
||||||
const { height: inputElementHeight } = useElementSize(inputElement);
|
const { height: inputElementHeight } = useElementSize(inputElement);
|
||||||
|
const styleStore = useStyleStore();
|
||||||
const config = reactive<Partial<FormatFnOptions>>({
|
const config = reactive<Partial<FormatFnOptions>>({
|
||||||
keywordCase: 'upper',
|
keywordCase: 'upper',
|
||||||
useTabs: false,
|
useTabs: false,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue