如何在打字稿中部署 nativescript-barcodescanner?

How to deploy nativescript-barcodescanner in typescript?

我正尝试 运行 从 https://github.com/EddyVerbruggen/nativescript-barcodescanner/tree/master/demo both locally and online at https://play.nativescript.org/?template=play-tsc&id=CB7XFu&v=2 进行演示,但没有成功。在操场上我添加了插件。

我注意到这里有一个类似的问题,但似乎是 3 年前的事了,之后插件发生了很大变化。

谁能试试 playground 并告诉我哪条线错了?我严格按照 github 中的演示进行操作。错误信息是Can't find variable: QRCodeReaderDelegate

使用 Playground(在线)或 Preview 命令(本地),您不能使用需要原生依赖的插件,例如 Barcode Scanner。

您必须在本地使用 tns [run|build] 命令构建项目,只有这样才能安装本机依赖项,​​您才能成功 运行 它们。