是否可以v-on:keyup.enter在整个页面上设置一个,而不仅仅是javascript框架中的输入元素Vue.js?
我尝试使用此代码示例构建一个测试应用程序
我定义了一个公共类,如下所示:
public class iSpeech
{
// Performs synthesis
public async Task<IRandomAccessStream> SynthesizeTextToSpeechAsync(string text)
{
IRandomAccessStream stream = null;
using (SpeechSynthesizer synthesizer = new SpeechSynthesizer())
{
VoiceInformation voiceInfo =
(
from voice in SpeechSynthesizer.AllVoices
where voice.Gender == VoiceGender.Male
select voice
).FirstOrDefault() ?? SpeechSynthesizer.DefaultVoice;
synthesizer.Voice = voiceInfo;
stream = await synthesizer.SynthesizeTextToStreamAsync(text);
}
return (stream);
}
// Build audio stream
public async Task SpeakTextAsync(string text, MediaElement mediaElement)
{
IRandomAccessStream stream = await this.SynthesizeTextToSpeechAsync(text);
await mediaElement.PlayStreamAsync(stream, true);
}
}
Run Code Online (Sandbox Code Playgroud)
从应用程序主页,然后我尝试调用:
public …Run Code Online (Sandbox Code Playgroud)