Use dotWe is a good choice, But if you want to develop locally on your own machine, you will set up your development environment.
You will need Node.js and the Weex CLi.
You can installing Node using nvm (Simple bash script to manage multiple active node.js versions). Run the following commands in a Terminal after installing nvm:
Node.js comes with npm, which lets you install the Weex Cli.
Run the following command in a Terminal:
NOTE: If you get an error like “permission error”, try installing with
Then you can use the weex command to verify that the installation is successful:
You can use CLi to generate a Weex project called “awesome-project”. Run the following command in a Terminal:
Then we enter the awesome-project folder, the CLi has been for us to generate a standard project structure.
We enter the awesome-project folder and install dependencies with the following commands:
Then we run
npm run dev and
npm run serve to start watch mode and static server.
Finally, we can see the Weex page in
You can modify this page in
src/foo.vue. The code is shown below:
If you’re curious to learn more about technical details, continue on to the next. And don’t forget to write code at dotWe and preview at anytime.