chore: format and remove console.log
This commit is contained in:
51
app.vue
51
app.vue
@@ -28,8 +28,6 @@ const updateQRCode = async () => {
|
|||||||
const logoUrl = `/${state.logo}.png`;
|
const logoUrl = `/${state.logo}.png`;
|
||||||
await renderQRCodeToCanvas(canvas.value, state.content, logoUrl);
|
await renderQRCodeToCanvas(canvas.value, state.content, logoUrl);
|
||||||
|
|
||||||
console.log(state.format);
|
|
||||||
|
|
||||||
qrCode.value = canvas.value.toDataURL(`image/${state.format}`);
|
qrCode.value = canvas.value.toDataURL(`image/${state.format}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -69,28 +67,61 @@ const copyQRCode = async () => {
|
|||||||
<NuxtRouteAnnouncer />
|
<NuxtRouteAnnouncer />
|
||||||
<canvas ref="canvas" class="hidden" />
|
<canvas ref="canvas" class="hidden" />
|
||||||
|
|
||||||
<div class="w-full h-full max-w-[850px] max-h-[375px] flex justify-between gap-8">
|
<div
|
||||||
|
class="w-full h-full max-w-[850px] max-h-[375px] flex justify-between gap-8"
|
||||||
|
>
|
||||||
<img :src="qrCode" class="h-full aspect-square" />
|
<img :src="qrCode" class="h-full aspect-square" />
|
||||||
|
|
||||||
<div class="flex-1 flex flex-col justify-center">
|
<div class="flex-1 flex flex-col justify-center">
|
||||||
<UForm :schema="settingsSchema" :state="state" class="space-y-4">
|
<UForm :schema="settingsSchema" :state="state" class="space-y-4">
|
||||||
<UFormGroup label="Username or link" name="content" @input="updateQRCode">
|
<UFormGroup
|
||||||
|
label="Username or link"
|
||||||
|
name="content"
|
||||||
|
@input="updateQRCode"
|
||||||
|
>
|
||||||
<UInput v-model="state.content" />
|
<UInput v-model="state.content" />
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
|
|
||||||
<UFormGroup label="Logo" name="logo">
|
<UFormGroup label="Logo" name="logo">
|
||||||
<USelectMenu v-model="state.logo" :options="LOGOS" searchable @change="updateQRCode" />
|
<USelectMenu
|
||||||
|
v-model="state.logo"
|
||||||
|
:options="LOGOS"
|
||||||
|
searchable
|
||||||
|
@change="updateQRCode"
|
||||||
|
/>
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
|
|
||||||
<UFormGroup label="Format" name="format">
|
<UFormGroup label="Format" name="format">
|
||||||
<USelectMenu v-model="state.format" :options="IMAGE_FORMATS" @change="updateQRCode" />
|
<USelectMenu
|
||||||
|
v-model="state.format"
|
||||||
|
:options="IMAGE_FORMATS"
|
||||||
|
@change="updateQRCode"
|
||||||
|
/>
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
|
|
||||||
<UButton block :icon="copyIcon" size="md" color="primary" variant="solid" :label="copyLabel" :trailing="false"
|
<UButton
|
||||||
:disabled="isQRCodeEmpty" @click="copyQRCode" />
|
block
|
||||||
|
:icon="copyIcon"
|
||||||
|
size="md"
|
||||||
|
color="primary"
|
||||||
|
variant="solid"
|
||||||
|
:label="copyLabel"
|
||||||
|
:trailing="false"
|
||||||
|
:disabled="isQRCodeEmpty"
|
||||||
|
@click="copyQRCode"
|
||||||
|
/>
|
||||||
|
|
||||||
<UButton block icon="i-heroicons-arrow-down-tray" size="md" color="primary" variant="solid" label="Download"
|
<UButton
|
||||||
:trailing="false" :disabled="isQRCodeEmpty" @click="downloadQRCode" />
|
block
|
||||||
|
icon="i-heroicons-arrow-down-tray"
|
||||||
|
size="md"
|
||||||
|
color="primary"
|
||||||
|
variant="solid"
|
||||||
|
label="Download"
|
||||||
|
:trailing="false"
|
||||||
|
:disabled="isQRCodeEmpty"
|
||||||
|
@click="downloadQRCode"
|
||||||
|
/>
|
||||||
</UForm>
|
</UForm>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user