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/html-entities/html-entities.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/html-entities/html-entities.vue')
-rw-r--r-- | src/tools/html-entities/html-entities.vue | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/tools/html-entities/html-entities.vue b/src/tools/html-entities/html-entities.vue index 0c75975..408542a 100644 --- a/src/tools/html-entities/html-entities.vue +++ b/src/tools/html-entities/html-entities.vue @@ -1,3 +1,17 @@ +<script setup lang="ts"> +import { escape, unescape } from 'lodash'; +import { computed, ref } from 'vue'; +import { useCopy } from '@/composable/copy'; + +const escapeInput = ref('<title>IT Tool</title>'); +const escapeOutput = computed(() => escape(escapeInput.value)); +const { copy: copyEscaped } = useCopy({ source: escapeOutput }); + +const unescapeInput = ref('<title>IT Tool</title'); +const unescapeOutput = computed(() => unescape(unescapeInput.value)); +const { copy: copyUnescaped } = useCopy({ source: unescapeOutput }); +</script> + <template> <c-card title="Escape html entities"> <n-form-item label="Your string :"> @@ -20,7 +34,9 @@ </n-form-item> <div flex justify-center> - <c-button @click="copyEscaped"> Copy </c-button> + <c-button @click="copyEscaped"> + Copy + </c-button> </div> </c-card> <c-card title="Unescape html entities"> @@ -44,21 +60,9 @@ </n-form-item> <div flex justify-center> - <c-button @click="copyUnescaped"> Copy </c-button> + <c-button @click="copyUnescaped"> + Copy + </c-button> </div> </c-card> </template> - -<script setup lang="ts"> -import { escape, unescape } from 'lodash'; -import { computed, ref } from 'vue'; -import { useCopy } from '@/composable/copy'; - -const escapeInput = ref('<title>IT Tool</title>'); -const escapeOutput = computed(() => escape(escapeInput.value)); -const { copy: copyEscaped } = useCopy({ source: escapeOutput }); - -const unescapeInput = ref('<title>IT Tool</title'); -const unescapeOutput = computed(() => unescape(unescapeInput.value)); -const { copy: copyUnescaped } = useCopy({ source: unescapeOutput }); -</script> |