How do you actually use Onsen with Vue.js and Cordova?
I am following this guide:
But I don’t understand how I am using cordova in there. I used the tool before and I had all the nice commands like “cordova platform add android” or “cordova build android”, but the example only resembles of a js application with a cordova directory structure.
Anybody knows how I can actually build an app for android? The guide is pretty misleading.
@LuCavallin If you are using the template mentioned in that pretty misleading guide, you just need to build it via
npm run buildin order to create the
wwwfolder with all the generated code from
srcfolder. That’s the last requirement to have a Cordova project and you’ll be able to run
cordova platform add androidand the like.
Just in case, that template is not installing Cordova or Android Studio. You need to do it yourself. For an easier solution, have a look at Monaca CLI (the link is actually provided after you install the template).
@Fran-Diox Do you know if it’s possible to integrate Cordova when I run
npm run devsuch that I can test out functions provided by their API without having to compile it every time?
@edgegfx Not in the browser. I think the easiest way is running
npm run build:watchand use Monaca Debugger, as explained in the link I provided in the last post. It will refresh the app automatically in your device.
@Fran-Diox Thanks, will do. I’m struggling to get ons.ready into my Vue project. Do you know where I would integrate that and how the code should look like?