- 博客(3)
- 收藏
- 关注
原创 解决:vue打包后在本地运行dist文件夹中index.html出现空白页面
vue开发项目是不是遇到过在vue项目在开发环境下一切正常,但在npm run build之后,打开dist文件中的index.html页面却是一片空白,打开控制台发现报错:Failed to load resource: net::ERR_FILE_NOT_FOUND出现这个问题的话,需要查看自己使用的是vue-cli2还是vue-cli3以上,他们处理方式不一样。一.vue-cli2处理方式:项目中找到config/index.js文件,将assetPublicPath的路径..
2021-07-08 23:26:19 7661 6
原创 Vue3---Vue3项目切换(设置)路由模式
解决用vue3项目npm run build 之后dist文件打开出现空白问题。 hash模式:在路由index.js文件中导入 createWebHashHistory import {createRouter,createWebHashHistory} from 'vue-router' 在路由index.js文件中导入注册使用createWebHashHistory const router = createRouter({ history: createWebHas..
2021-07-07 18:12:38 1269
原创 vue-cli3以上项目build后,dist文件夹里HTML打开显示空白(控制台报错)
vue-cli3.0以上项目build后,dist文件夹里HTML打开显示空白解决办法: 1. 在项目根目录新建 vue.config.js 文件 2. 文件内输入以下代码module.exports = { publicPath: './', //配置本地引用目录文件,如不配置,默认为`/`}...
2021-07-07 16:46:34 234
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人