在 package.json 文件中做出修改。如下图所示
"scripts": {
"serve": "vue-cli-service serve",
"dev": "vue-cli-service serve",
"build": "vue-cli-service build",
"build:prod": "vue-cli-service build --mode production",
"build:dev": "vue-cli-service build --mode development",
"lint": "vue-cli-service lint"
},
- 默认vue3.0的本地启动为: npm run serve
- 这样就可以使用: npm run dev 在本地运行项目了。