File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ export default {
41
41
type: String ,
42
42
default: ' fullscreen' ,
43
43
},
44
+ clipboard: {
45
+ type: Boolean ,
46
+ default: false ,
47
+ },
44
48
},
45
49
emits: [' voiceTranscript' , ' onStatus' ],
46
50
setup (props , { emit }) {
@@ -123,6 +127,16 @@ export default {
123
127
translatedText .value = interimTranscript || finalTranscript .value ;
124
128
125
129
if (finalTranscript .value ) {
130
+ if (props .clipboard ) {
131
+ navigator .clipboard .writeText (finalTranscript .value ).then (
132
+ () => {
133
+ console .log (' Text copied to clipboard' );
134
+ },
135
+ (err ) => {
136
+ console .error (' Could not copy text to clipboard' , err);
137
+ }
138
+ );
139
+ }
126
140
emit (' voiceTranscript' , finalTranscript .value );
127
141
deactivateVoice ();
128
142
}
You can’t perform that action at this time.
0 commit comments