mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-25 17:26:15 -04:00
refactor(lint): linter auto fix
This commit is contained in:
parent
8e29a97404
commit
086d31eab5
54 changed files with 1122 additions and 1503 deletions
|
@ -1,86 +1,51 @@
|
|||
<template>
|
||||
<n-card title="Text to base64">
|
||||
<n-input
|
||||
v-model:value="textInput"
|
||||
type="textarea"
|
||||
placeholder="Put your string here..."
|
||||
/>
|
||||
<n-input
|
||||
:value="textBase64"
|
||||
type="textarea"
|
||||
readonly
|
||||
/>
|
||||
<n-input v-model:value="textInput" type="textarea" placeholder="Put your string here..." />
|
||||
<n-input :value="textBase64" type="textarea" readonly />
|
||||
<n-space justify="center">
|
||||
<n-button
|
||||
secondary
|
||||
@click="copyTextBase64()"
|
||||
>
|
||||
Copy
|
||||
</n-button>
|
||||
<n-button secondary @click="copyTextBase64()"> Copy </n-button>
|
||||
</n-space>
|
||||
</n-card>
|
||||
|
||||
<n-card title="File to base64">
|
||||
<n-upload
|
||||
v-model:file-list="fileList"
|
||||
:show-file-list="true"
|
||||
:on-before-upload="onUpload"
|
||||
list-type="image"
|
||||
>
|
||||
<n-upload v-model:file-list="fileList" :show-file-list="true" :on-before-upload="onUpload" list-type="image">
|
||||
<n-upload-dragger>
|
||||
<div style="margin-bottom: 12px">
|
||||
<n-icon
|
||||
size="35"
|
||||
:depth="3"
|
||||
:component="Upload"
|
||||
/>
|
||||
<n-icon size="35" :depth="3" :component="Upload" />
|
||||
</div>
|
||||
<n-text style="font-size: 14px">
|
||||
Click or drag a file to this area to upload
|
||||
</n-text>
|
||||
<n-text style="font-size: 14px"> Click or drag a file to this area to upload </n-text>
|
||||
</n-upload-dragger>
|
||||
</n-upload>
|
||||
|
||||
<n-input
|
||||
:value="fileBase64"
|
||||
type="textarea"
|
||||
readonly
|
||||
/>
|
||||
<n-input :value="fileBase64" type="textarea" readonly />
|
||||
<n-space justify="center">
|
||||
<n-button
|
||||
secondary
|
||||
@click="copyFileBase64()"
|
||||
>
|
||||
Copy
|
||||
</n-button>
|
||||
<n-button secondary @click="copyFileBase64()"> Copy </n-button>
|
||||
</n-space>
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useCopy } from '@/composable/copy'
|
||||
import { useBase64 } from '@vueuse/core'
|
||||
import { Upload } from '@vicons/tabler'
|
||||
import { ref, type Ref } from 'vue'
|
||||
import { useCopy } from '@/composable/copy';
|
||||
import { useBase64 } from '@vueuse/core';
|
||||
import { Upload } from '@vicons/tabler';
|
||||
import { ref, type Ref } from 'vue';
|
||||
import type { UploadFileInfo } from 'naive-ui';
|
||||
|
||||
const textInput = ref('')
|
||||
const { base64: textBase64 } = useBase64(textInput)
|
||||
const { copy: copyTextBase64 } = useCopy({ source: textBase64, text: 'Base64 string copied to the clipboard' })
|
||||
const textInput = ref('');
|
||||
const { base64: textBase64 } = useBase64(textInput);
|
||||
const { copy: copyTextBase64 } = useCopy({ source: textBase64, text: 'Base64 string copied to the clipboard' });
|
||||
|
||||
const fileList = ref()
|
||||
const fileInput = ref() as Ref<File>
|
||||
const { base64: fileBase64 } = useBase64(fileInput)
|
||||
const { copy: copyFileBase64 } = useCopy({ source: fileBase64, text: 'Base64 string copied to the clipboard' })
|
||||
const fileList = ref();
|
||||
const fileInput = ref() as Ref<File>;
|
||||
const { base64: fileBase64 } = useBase64(fileInput);
|
||||
const { copy: copyFileBase64 } = useCopy({ source: fileBase64, text: 'Base64 string copied to the clipboard' });
|
||||
|
||||
|
||||
function onUpload({ file: { file }, }: { file: UploadFileInfo }) {
|
||||
function onUpload({ file: { file } }: { file: UploadFileInfo }) {
|
||||
if (file) {
|
||||
fileList.value = []
|
||||
fileInput.value = file
|
||||
fileList.value = [];
|
||||
fileInput.value = file;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
@ -93,4 +58,4 @@ function onUpload({ file: { file }, }: { file: UploadFileInfo }) {
|
|||
::v-deep(.n-upload-trigger) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue