vue快速创建项目学习记录

Vue Router 介绍:https://router.vuejs.org/zh/

快速搭建和安装Vue.js项目:学习记录。

$cnpm install vue    # 安装 vue
$cnpm install --global vue-cli    #全局安装vue-cli  
$ vue init webpack vue-project1    # 进行一些配置,输入项目名,其余默认回车

? Project name vue0314
? Project description A Vue.js project
? Author too-hoo <phone.example@163.com>
? Vue build standalone                #打包方式
? Install vue-router? Yes
? Use ESLint to lint your code? Yes    #使用ESLint规范代码
? Pick an ESLint preset Standard    
? Set up unit tests Yes                #单元测试
? Pick a test runner jest
? Setup e2e tests with Nightwatch? Yes    
? Should we run `npm install` for you after the project has been created? (recommended) npm

   vue-cli · Generated "vue-project1".


# Installing project dependencies ...
# ========================

npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features!
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0

> chromedriver@2.46.0 install /home/toohoo/learnVue/ROW/vue-project1/node_modules/chromedriver
> node install.js

Current existing ChromeDriver binary is unavailable, proceding with download and extraction.
Downloading from file:  https://chromedriver.storage.googleapis.com/2.46/chromedriver_linux64.zip
Saving to file: /tmp/2.46/chromedriver/chromedriver_linux64.zip
Received 782K...
Received 1568K...
Received 2352K...
Received 3136K...
Received 3920K...
Received 4704K...
Received 5277K total.
Extracting zip contents
Copying to target path /home/toohoo/learnVue/ROW/vue-project1/node_modules/chromedriver/lib/chromedriver
Fixing file permissions
Done. ChromeDriver binary available at /home/toohoo/learnVue/ROW/vue-project1/node_modules/chromedriver/lib/chromedriver/chromedriver

> uglifyjs-webpack-plugin@0.4.6 postinstall /home/toohoo/learnVue/ROW/vue-project1/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1590 packages from 1090 contributors and audited 30843 packages in 249.962s
found 73 vulnerabilities (66 low, 1 moderate, 5 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details


Running eslint --fix to comply with chosen preset rules...
# ========================


> vue0314@1.0.0 lint /home/toohoo/learnVue/ROW/vue-project1
> eslint --ext .js,.vue src test/unit test/e2e/specs "--fix"


# Project initialization finished!
# ========================

To get started:

  cd vue-project1
  npm run dev
  
Documentation can be found at https://vuejs-templates.github.io/webpack

搭建项目完成,进入目录安装和访问测试:

toohoo@ubuntu:~/learnVue/ROW$ cd vue-project1/    # 进入工程目录
toohoo@ubuntu:~/learnVue/ROW/vue-project1$ ls
build  config  index.html  node_modules  package.json  package-lock.json  README.md  src  static  test
toohoo@ubuntu:~/learnVue/ROW/vue-project1$ cnpm install    #开始安装
✔ Installed 58 packages
✔ Linked 0 latest versions
✔ Run 0 scripts
✔ All packages installed (used 143ms(network 140ms), speed 0B/s, json 0(0B), tarball 0B)
toohoo@ubuntu:~/learnVue/ROW/vue-project1$ ls
build  config  index.html  node_modules  package.json  package-lock.json  README.md  src  static  test
toohoo@ubuntu:~/learnVue/ROW/vue-project1$ cnpm run dev    #运行工程

> vue0314@1.0.0 dev /home/toohoo/learnVue/ROW/vue-project1
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

 12% building modules 21/28 modules 7 active ...roject1/src/components/HelloWorld.vue{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.
 95% emitting                                                                         

 DONE  Compiled successfully in 22027ms                                                                                            10:36:17 AM

 I  Your application is running here: http://localhost:8080

访问http://localhost:8080  显示创建项目成功。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值