diff --git a/src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue b/src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue index 9085725f9..ccd8b519a 100644 --- a/src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue +++ b/src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue @@ -2,6 +2,7 @@ import { generateLoremIpsum } from './lorem-ipsum-generator.service'; import { useCopy } from '@/composable/copy'; import { randIntFromInterval } from '@/utils/random'; +import { computedRefreshable } from '@/composable/computedRefreshable'; const paragraphs = ref(1); const sentences = ref([3, 8]); @@ -9,7 +10,7 @@ const words = ref([8, 15]); const startWithLoremIpsum = ref(true); const asHTML = ref(false); -const loremIpsumText = computed(() => +const [loremIpsumText, refreshLoremIpsum] = computedRefreshable(() => generateLoremIpsum({ paragraphCount: paragraphs.value, asHTML: asHTML.value, @@ -18,6 +19,7 @@ const loremIpsumText = computed(() => startWithLoremIpsum: startWithLoremIpsum.value, }), ); + const { copy } = useCopy({ source: loremIpsumText, text: 'Lorem ipsum copied to the clipboard' }); @@ -41,10 +43,13 @@ const { copy } = useCopy({ source: loremIpsumText, text: 'Lorem ipsum copied to -
+
Copy + + Refresh +