Vue3 搭建 及 打包

 搭建

// 全局安装 vue
npm install -g @vue/cli
// 查看 vue 当前版本
vue -V
// 创建项目
vue create 【项目名】
// 注意项目名别大小写

打包

npm run build

 

出现 Build domplete  就代表打包成功了

打包完成后,如果双击打开 dist 下的 index.html, 在浏览器页面时空白,想要正常显示则需要修改一下  index.html 文件中 js、css 文件路径。

dist/index.html 文件下 的 css 和 js 文件路径是绝对路径

修改为相对路径

 这样就能正常展示了~

扫描二维码关注公众号,回复: 15531285 查看本文章

猜你喜欢

转载自blog.csdn.net/m0_53574149/article/details/129048480