mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-21 15: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,34 +1,33 @@
|
|||
<script lang="ts" setup>
|
||||
import { SearchRound } from '@vicons/material'
|
||||
import { SearchRound } from '@vicons/material';
|
||||
import { computed, ref } from 'vue';
|
||||
import { deburr } from 'lodash'
|
||||
import { deburr } from 'lodash';
|
||||
import { tools } from '@/tools';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const router = useRouter()
|
||||
const queryString = ref('')
|
||||
const router = useRouter();
|
||||
const queryString = ref('');
|
||||
|
||||
const cleanString = (s: string) => deburr(s.trim().toLowerCase())
|
||||
const cleanString = (s: string) => deburr(s.trim().toLowerCase());
|
||||
|
||||
const searchableTools = tools.map(({ name, description, keywords, path }) => ({
|
||||
searchableText: [name, description, ...keywords].map(cleanString).join(' '),
|
||||
path,
|
||||
name
|
||||
}))
|
||||
searchableText: [name, description, ...keywords].map(cleanString).join(' '),
|
||||
path,
|
||||
name,
|
||||
}));
|
||||
|
||||
const options = computed(() => {
|
||||
const query = cleanString(queryString.value)
|
||||
const query = cleanString(queryString.value);
|
||||
|
||||
return searchableTools
|
||||
.filter(({ searchableText }) => searchableText.includes(query))
|
||||
.map(({ name, path }) => ({ label: name, value: path }))
|
||||
})
|
||||
return searchableTools
|
||||
.filter(({ searchableText }) => searchableText.includes(query))
|
||||
.map(({ name, path }) => ({ label: name, value: path }));
|
||||
});
|
||||
|
||||
function onSelect(path: string) {
|
||||
router.push(path)
|
||||
queryString.value = ''
|
||||
router.push(path);
|
||||
queryString.value = '';
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -58,9 +57,8 @@ function onSelect(path: string) {
|
|||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<style lang="less" scoped>
|
||||
// ::v-deep(.n-input__border) {
|
||||
// border: none;
|
||||
// }
|
||||
</style>
|
||||
</style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue