创建uniapp 的方法
PS:这种方式比起用HBuilder X创建后运行的项目体积会更小至少小于一倍。
指令
- 指令安装
vue create -p dcloudio/uni-preset-vue my-project
- 如果没有安装Vue,先安装Vue
npm install -g @vue/cli
运行方法
-
npm run serve
默认是H5
-
其它运行方法准看
package.json
我用的HBuilder X创建的项目怎么换成?
- 把HBuilder X创建的项目替换到指令安装的项目中
src
目录