admin管理员组

文章数量:1534214

现象

在使用前端工具vite(版本5),搭建vue3项目时,启动vite,浏览器显示页面:找不到localhost的网页,

起初怀疑是 未加参数 --host='0.0.0.0',导致,后加上该参数后问题依旧

解决

将index.html页面从public移动至根目录(package.json同一级目录下),自此问题解决。

后查询资料得知

原因

在使用@vue/cli-service库时,index.html页面在public文件夹下,就认为vite同样如此

参考

https://vitejs/guide/#index-html-and-project-root

本文标签: 找不到浏览器页面网页项目