“Vue项目搭建”的版本间的差异
跳到导航
跳到搜索
(→项目搭建) |
|||
第2行: | 第2行: | ||
== '''项目搭建''' == | == '''项目搭建''' == | ||
=== 安装webpack === | === 项目已存在 === | ||
=== 新建项目 === | |||
==== 安装webpack ==== | |||
npm install webpack –g | npm install webpack –g | ||
[[文件:Webpack.png|缩略图|665x665px|无]] | [[文件:Webpack.png|缩略图|665x665px|无]] | ||
=== 安装vue脚手架 === | ==== 安装vue脚手架 ==== | ||
npm install -g @vue/cli | npm install -g @vue/cli | ||
[[文件:@vue-cli.png|缩略图|1339x1339px|无]] | [[文件:@vue-cli.png|缩略图|1339x1339px|无]] | ||
=== 创建项目 === | ==== 创建项目 ==== | ||
在你想要放置的目录下执行Vue create my_text | 在你想要放置的目录下执行Vue create my_text | ||
[[文件:My-text.png|缩略图|547x547像素|无]] | [[文件:My-text.png|缩略图|547x547像素|无]] | ||
三种配置选择一种回车 | 三种配置选择一种回车 | ||
[[文件:Enter.png|缩略图|853x853px|无]] | [[文件:Enter.png|缩略图|853x853px|无]] | ||
=== 启动项目 === | ==== 启动项目 ==== | ||
<syntaxhighlight line="1"> | <syntaxhighlight line="1"> | ||
cd my_test | cd my_test | ||
第21行: | 第25行: | ||
</syntaxhighlight>[[文件:Run.png|缩略图|712x712px|无]] | </syntaxhighlight>[[文件:Run.png|缩略图|712x712px|无]] | ||
=== 访问项目 === | ==== 访问项目 ==== | ||
访问 <nowiki>http://localhost:8081/</nowiki> | 访问 <nowiki>http://localhost:8081/</nowiki> | ||
[[文件:Open.png|缩略图|666x666px|无]] | [[文件:Open.png|缩略图|666x666px|无]] | ||
=== 项目所在位置 === | ==== 项目所在位置 ==== | ||
[[文件:Position.png|缩略图|907x907px|无]] | [[文件:Position.png|缩略图|907x907px|无]] |
2021年12月14日 (二) 03:13的版本
环境搭建
项目搭建
项目已存在
新建项目
安装webpack
npm install webpack –g
安装vue脚手架
npm install -g @vue/cli
创建项目
在你想要放置的目录下执行Vue create my_text
三种配置选择一种回车
启动项目
cd my_test
npm run serve
访问项目
访问 http://localhost:8081/