typescript - 如何在 vue 组件中实现 typescript 代码?
问题描述
https://github.com/bradmartin/nativescript-texttospeech
texttospeech 有用 TS 编写的文档。
如何将代码翻译成ns-VUE?
import { TNSTextToSpeech, SpeakOptions } from 'nativescript-texttospeech';
let TTS = new TNSTextToSpeech();
let speakOptions: SpeakOptions = {
text: 'hello world',
};
TTS.speak(speakOptions);
我不想使用打字稿,我只需要一个在 Nativescript-Vue 中说话的按钮。
提前致谢
解决方案
只需从 中删除类型speakOptions
并将其从导入中删除:
import { TNSTextToSpeech } from 'nativescript-texttospeech';
let TTS = new TNSTextToSpeech();
let speakOptions = {
text: 'hello world',
};
TTS.speak(speakOptions);
推荐阅读
- amazon-web-services - 将数据从 AWS Glue 数据目录提取到外部文本文件
- node.js - 如何在没有 root 的情况下从 Ubuntu 18.04.3 中完全删除节点?
- flutter - 如何在颤动中显示小吃吧无限持续时间?
- javascript - 如何在 JS FETCH API 之外访问返回值
- python - 如何解决与在 Windows 10 上安装 dlib 相关的问题?
- c# - HashSet 重叠不能按预期工作
- netlogo - 如何让Netlogo模型自动停止,关闭文件并重新启动模型
- wordpress - 使用 SSL 的 WordPress 多站点主页重定向问题
- node.js - NODEJS INSERT DATA INTO POSTGRESQL(错误:“$”处或附近的语法错误)
- angular - 在 ng-zorro 的 nz-upload 中上传文件时如何禁用删除选项?