How to use Cordova to package Vue projects

Source: Internet
Author: User
Tags install node

I. Preparing the Environment
1. Install node and NPM;
#npm
2. Install the VUE environment:
3. Install Cordova, website link address: http://cordova.axuer.com/#getstarted br> #npm install-g Cordova
Two. Build a project
1. Create a Vue project;
2. Create a Cordova project in the Vue project file directory

  #cordova Create path (folder name) ID (app ID name) name (app name)
    Exmple:cordova Create MyProject com.example.myproject Testpro
  (this time you can have more folders in the Vue directory)

   #cd  folder name
   #cordova Platform add iOS
   #cordova platform add Android 

 ( Commands that run the Add or remove platforms will affect the content of the project platforms, with a subdirectory in each of the specified platforms in this directory

 #cordova platform LS (check your current platform settings)

 " Note: I am using the device is Mac, because ANDROIDSDK Gredla version too must not error, the solution is to download an up-to-date version of https://gradle.org/install/  ;
 then configure the gradle environment;
   My native Gradle path is/users/lanjing/downloads/gradle-4.6;
  1. Open the Mac terminal and enter in the terminal: OPEN-E. Bash_profile, open the. bash_profile file; If the error says that there is no such file, create a vim ~/.bash_profile;
  2. Edit. Bash_ Profile file, enter the following in the. bash_profile file:

  gradle_home=/users/zhoujian/gradle/gradle-3.3; (GRADLE's native path)
  Export gradle_home
  export path= $PATH: $GRADLE _home/bin

3. Save the. bash_profile file, execute the source ~/.bash_profile on the terminal, Update the. bash_profile file to perform gradle-version on the terminal to see if the configuration was successful. Re-entry into Vue's Cordova directory run #cordova platform LS "

to build and run the app, you need to install each SDK you need for the platform;

Three. Prepare for packaging work
1. First modify the index.html of the Vue project and add it between the head

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.