diff options
author | 2023-05-28 23:13:24 +0200 | |
---|---|---|
committer | 2023-05-28 23:29:14 +0200 | |
commit | 33c9b6643f58a6930043f460d5bfdca4bc1f7222 (patch) | |
tree | f313935e30f7b90ea16e564e7171e2e72319ce29 /src/tools/slugify-string/slugify-string.vue | |
parent | 4d2b037dbe4e78aa90a4a6d9c7315dcf0a51fed9 (diff) | |
download | it-tools-33c9b6643f58a6930043f460d5bfdca4bc1f7222.tar.gz it-tools-33c9b6643f58a6930043f460d5bfdca4bc1f7222.tar.zst it-tools-33c9b6643f58a6930043f460d5bfdca4bc1f7222.zip |
chore(lint): switched to a better lint config
Diffstat (limited to 'src/tools/slugify-string/slugify-string.vue')
-rw-r--r-- | src/tools/slugify-string/slugify-string.vue | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/tools/slugify-string/slugify-string.vue b/src/tools/slugify-string/slugify-string.vue index c140e21..0f5ddc2 100644 --- a/src/tools/slugify-string/slugify-string.vue +++ b/src/tools/slugify-string/slugify-string.vue @@ -1,7 +1,18 @@ +<script setup lang="ts"> +import { computed, ref } from 'vue'; +import slugify from '@sindresorhus/slugify'; +import { withDefaultOnError } from '@/utils/defaults'; +import { useCopy } from '@/composable/copy'; + +const input = ref(''); +const slug = computed(() => withDefaultOnError(() => slugify(input.value), '')); +const { copy } = useCopy({ source: slug, text: 'Slug copied to clipboard' }); +</script> + <template> <div> <n-form-item label="Your string to slugify"> - <n-input v-model:value="input" type="textarea" placeholder="Put your string here (ex: My file path)"></n-input> + <n-input v-model:value="input" type="textarea" placeholder="Put your string here (ex: My file path)" /> </n-form-item> <n-form-item label="Your slug"> @@ -10,24 +21,13 @@ type="textarea" readonly placeholder="You slug will be generated here (ex: my-file-path)" - ></n-input> + /> </n-form-item> <div flex justify-center> - <c-button :disabled="slug.length === 0" @click="copy">Copy slug</c-button> + <c-button :disabled="slug.length === 0" @click="copy"> + Copy slug + </c-button> </div> </div> </template> - -<script setup lang="ts"> -import { computed, ref } from 'vue'; -import slugify from '@sindresorhus/slugify'; -import { withDefaultOnError } from '@/utils/defaults'; -import { useCopy } from '@/composable/copy'; - -const input = ref(''); -const slug = computed(() => withDefaultOnError(() => slugify(input.value), '')); -const { copy } = useCopy({ source: slug, text: 'Slug copied to clipboard' }); -</script> - -<style lang="less" scoped></style> |