Using dotWe is a good choice, but if you want to develop locally on your own machine, you will need to set up your development environment.
You will need Node.js and the Weex CLI.
Install Node.js using nvm (Simple bash script to manage multiple active Node.js versions). Run the following commands in a terminal after installing nvm:
npm comes with Node.js, with witch you can install the Weex command line tools.
NOTE: After upgrading the
weex-toolkit to v1.0.8, the
npm-shrinkwrap.json npm 5 specification has been added to lock the package dependencies, it is needed to upgrade your npm version to 5 above by command:
npm install npm @latest -g if your version is lower than this, please check your npm version before using it.
Run the following commands in a terminal:
You can use ‘weex update
NOTE: If you receive an error like “permission error”, try another time with
Then you can use the Weex command to verify if the installation is successful:
Use the command line tool to generate a Weex project called “awesome-project”. Run the following command in a terminal:
Then enter the awesome-project folder, you will see a standard project skeleton has been generated.
In the awesome-project folder, install dependencies with the following command:
npm run serve in root directory to start watching mode and static server.
Finally, you can access the Weex page in
This page can be modified in
src/index.vue. The codes are shown below:
For more technical details, please continue to read the next section. And don’t forget to write and preview your codes at dotWe.