将 Cordova 插件添加到 Platypi 项目

Adding Cordova Plugins to Platypi Project

如何将 cordova 插件添加到 Platypi 项目?

我开始使用新的移动开发框架 Platypi。

我想在项目中添加一个Cordova插件,专门用于扫描二维码

我已尝试使用以下命令从命令行添加插件,但出现错误“当前工作目录不是基于 Cordova 的项目。

cordova plugin add com.phonegap.plugins.barcodescanner

谢谢。

如果您正在使用 CLI you can simply open the Gruntfile.js in the root project directory and add 'com.phonegap.plugins.barcodescanner' to the cordovacli:add_plugins g运行t 任务。然后您可以再次删除 cordova 文件夹和 运行 grunt setup-cordova。或者,如果您已经为 cordova 修改了项目文件,您可以 运行 grunt cordovacli:add_plugins 避免覆盖任何内容。