mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-20 23:06:14 -04:00
refactor(qr-code): multiline input
This commit is contained in:
parent
f68e859c20
commit
f3480fe560
2 changed files with 7 additions and 2 deletions
|
@ -4,7 +4,12 @@
|
||||||
<n-gi span="2">
|
<n-gi span="2">
|
||||||
<n-form label-width="130" label-placement="left">
|
<n-form label-width="130" label-placement="left">
|
||||||
<n-form-item label="Text:">
|
<n-form-item label="Text:">
|
||||||
<n-input v-model:value="text" placeholder="Your link or text..." />
|
<n-input
|
||||||
|
v-model:value="text"
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 1 }"
|
||||||
|
placeholder="Your link or text..."
|
||||||
|
/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item label="Foreground color:">
|
<n-form-item label="Foreground color:">
|
||||||
<n-color-picker v-model:value="foreground" :modes="['hex']" />
|
<n-color-picker v-model:value="foreground" :modes="['hex']" />
|
||||||
|
|
|
@ -19,7 +19,7 @@ export function useQRCode({
|
||||||
[text, background, foreground, errorCorrectionLevel].filter(isRef),
|
[text, background, foreground, errorCorrectionLevel].filter(isRef),
|
||||||
async () => {
|
async () => {
|
||||||
if (get(text))
|
if (get(text))
|
||||||
qrcode.value = await QRCode.toDataURL(get(text), {
|
qrcode.value = await QRCode.toDataURL(get(text).trim(), {
|
||||||
color: {
|
color: {
|
||||||
dark: get(foreground),
|
dark: get(foreground),
|
||||||
light: get(background),
|
light: get(background),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue