vue3默认npm run serve打开
时间: 2023-11-02 11:19:55 浏览: 109
vue3项目,带增删改,连带node_modules包,下载后运行npm run serve启动
4星 · 用户满意度95%
在Vue 3中,默认情况下执行`npm run serve`命令不会自动打开浏览器。如果你想要实现自动打开功能,你可以在项目根目录下的配置文件(package.json)中进行配置。具体来说,你需要在`scripts`字段中添加`--open`选项。例如:
```json
"scripts": {
"serve": "vue-cli-service serve --open",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
}
```
这样,在执行`npm run serve`命令时,它将会自动打开浏览器。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [vue2项目npm run serve自动打开网页为0.0.0.0](https://blog.csdn.net/LlanyW/article/details/128330973)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [vue3运行npm run serve无反应,选择跳转后会自动跳入文件路径中](https://blog.csdn.net/a2986467829/article/details/126836719)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文