欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 教育 > 培训 > vue3+elementplus新建项目

vue3+elementplus新建项目

2025/2/22 2:23:24 来源:https://blog.csdn.net/qq_35090060/article/details/145671501  浏览:    关键词:vue3+elementplus新建项目

更新node.js和npm

node.js官网更新指南
可以根据自己的操作系统进行选择
我的电脑操作系统是mac os所以我的步骤如下

# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"# Download and install Node.js:
nvm install 22# Verify the Node.js version:
node -v # Should print "v22.14.0".
nvm current # Should print "v22.14.0".# Verify npm version:
npm -v # Should print "10.9.2".

vue3新建项目

vue3官网操作指引

如果以下指令报错说没有权限mkdir之类的,就在指令前面加上sudo
例如
sudo npm run dev

npm create vue@latest
cd <your-project-name>
npm install
npm run dev
#如果你要打包
npm run build

引入elementplus

npm install element-plus --save

在main.js中引入elementplus配置

import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'const app = createApp(App)app.use(ElementPlus)
app.mount('#app')

去掉项目边框

将项目中的
/src/assets/base.css
/src/assets/main.css
的内容全都注释掉即可。

常用的svg库

阿里svg库iconfont

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词