blob: 1a2192e0c6be223f19a31168f6d748402047537a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
<script setup lang="ts">
import { escape, unescape } from 'lodash';
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 :">
<c-input-text
v-model:value="escapeInput"
multiline
placeholder="The string to escape"
rows="3"
autosize
raw-text
/>
</n-form-item>
<n-form-item label="Your string escaped :">
<c-input-text
multiline
readonly
placeholder="Your string escaped"
:value="escapeOutput"
rows="3"
autosize
/>
</n-form-item>
<div flex justify-center>
<c-button @click="copyEscaped()">
Copy
</c-button>
</div>
</c-card>
<c-card title="Unescape html entities">
<n-form-item label="Your escaped string :">
<c-input-text
v-model:value="unescapeInput"
multiline
placeholder="The string to unescape"
rows="3"
autosize
raw-text
/>
</n-form-item>
<n-form-item label="Your string unescaped :">
<c-input-text
:value="unescapeOutput"
multiline
readonly
placeholder="Your string unescaped"
rows="3"
autosize
/>
</n-form-item>
<div flex justify-center>
<c-button @click="copyUnescaped()">
Copy
</c-button>
</div>
</c-card>
</template>
|