Skip to content

Commit 9102ba2

Browse files
update example usage voice capture
1 parent 1d5cc0b commit 9102ba2

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

src/App.config.ts

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,39 @@ export const configApp = {
1818
{
1919
name: 'Usage',
2020
language: 'tsx',
21-
content: `import VoiceCaptureVue from 'voicecapture-vue'
21+
content: `<script setup>
22+
import { ref } from 'vue';
23+
import VoiceCaptureVue from 'voicecapture-vue';
2224
23-
<VoiceCaptureVue />`,
25+
const isVoiceCaptureExample = ref(false);
26+
const voiceTextTranscript = ref('');
27+
28+
function openVoiceCapture() {
29+
isVoiceCaptureExample.value = true;
30+
}
31+
32+
function statusVoiceCapture(value) {
33+
isVoiceCaptureExample.value = value;
34+
}
35+
36+
function returnVoiceTranscript(transcript) {
37+
voiceTextTranscript.value = transcript;
38+
}
39+
</script>
40+
41+
<template>
42+
<VoiceCaptureVue
43+
:status="isVoiceCaptureExample"
44+
@voiceTranscript="returnVoiceTranscript"
45+
@onStatus="s tatusVoiceCapture"
46+
/>
47+
<textarea
48+
v-if="voiceTextTranscript"
49+
v-model="voiceTextTranscript"
50+
placeholder="Text Voice Transcript"
51+
>
52+
</textarea>
53+
</template>`,
2454
},
2555
],
2656
}

0 commit comments

Comments
 (0)