前言

小白一枚,今年(2019)准备学习一下前端的技术,因为发现自己对后端(python)相对比较熟悉但是还是写不出一个优雅的系统,可见前端的重要性,于是静下心来跟大佬学习。在不断的激励自己调整自己的情绪,满足一下自己对技术的兴趣。大佬教的也比较直接,没有讲述太多原理(自己去看就行),而是直接上手操作vue项目。 喜欢这样的讲课风格,以下是第一天的学习笔记。

开发工具Visual Studio Code

安装插件

#插件列表
Auto Close Tag
Auto Rename Tag
Beautify
Chinese (Simplified) Language Pack for Visual Studio Code
ESLint
Path Intellisense
Prettier - Code formatter
Vetur

设置中文语言:command + shift + P,搜索框中输入“configure display language”,更改成以下内容,然后重启vscode。

{
// Defines VS Code's display language.
// See https://go.microsoft.com/fwlink/?LinkId=761051 for a list of supported languages. //"locale":"en" // Changes will not take effect until VS Code has been restarted.
"locale":"zh-CN";
}

更改默认配置: 首选项->设置->然后点击右上角的{}->将下面的代码粘贴到里面->保存->重启工具(建议)

{
"editor.fontSize": 15,
"eslint.autoFixOnSave": true,
"prettier.eslintIntegration": true,
"eslint.validate": [
"javascript",{
"language": "vue",
"autoFix": true
},"html",
"vue"
],
}

到此基本的开发工具配置完成。

Vue配置

创建项目目录:然后拖入vscode->终端中打开,然后会显示出一个终端。

安装vue

npm install -g vue-cli
npm install cnpm -g --registry=https://registry.npm.taobao.org
vue --version

新建vue项目

ZeyangdeMacBook-Pro:~ test$ vue init webpack demo01

? Project name demo01
? Project description A Vue.js project
? Author Lizeyang <xxxxx@qq.com>
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recommended) npm vue-cli · Generated "demo01". # 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. > fsevents@1.2.4 install /Users/zeyang/demo01/node_modules/fsevents
> node install [fsevents] Success: "/Users/zeyang/demo01/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile > uglifyjs-webpack-plugin@0.4.6 postinstall /Users/zeyang/demo01/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.
added 1305 packages from 698 contributors and audited 11083 packages in 58.494s
found 2 vulnerabilities (1 moderate, 1 high)
run `npm audit fix` to fix them, or `npm audit` for details Running eslint --fix to comply with chosen preset rules...
# ======================== > demo01@1.0.0 lint /Users/xxx/demo01
> eslint --ext .js,.vue src "--fix" # Project initialization finished!
# ======================== To get started: cd demo01
npm run dev Documentation can be found at https://vuejs-templates.github.io/webpack

启动项目

#启动测试项目
npm run dev 或者是 npm run start
DONE Compiled successfully in 5923ms I Your application is running here: http://localhost:8080

访问本机的8080端口验证效果

01-vue学习篇-以优雅的姿势创建vue项目的更多相关文章

  1. 02-vue学习篇-以正确的姿势使用vue

    1.渲染数据 #view层 <div class="hello"> <h1>{{ msg }}</h1> //msg </div> ...

  2. Vue学习笔记-nodejs+vue-cli4+webpack按装配置+项目创建

    一  使用环境: windows 7 64位操作系统 二  Vue学习-nodejs按装配置,Node.js 就是运行在服务端的 JavaScript. 1. 去nodejs的官网下载  https: ...

  3. Vue学习(二) :第一个Vue项目

    OS: Windows 10 Home 64bit Chocolatey version: 0.10.13 npm version: 6.4.1 yarn version: 1.16.0 git ve ...

  4. Cordova+vue 混合app开发(一)创建Cordova项目

    简介: Cordova包装你的HTML/JavaScript app到原生app容器中,可以让你访问每个平台设备的功能.这些功能通过统一的JavaScript API提供,让你轻松的编写一组代码运行在 ...

  5. 快乐学习 Ionic Framework+PhoneGap 手册1-1{创建APP项目}

    快乐学习 Ionic Framework+PhoneGap 手册1-1 * 前提必须安装 Node.js,安装PhoneGap,搭建Android开发环境,建议使用真机调试 {1.1}= 创建APP项 ...

  6. maven学习(八)——使用maven创建javaweb项目

    构建JavaWeb项目 1.创建JavaWeb项目 1.使用mvn archetype:generate命令,如下所示: mvn archetype:generate -DgroupId=com.my ...

  7. Vue 基于node npm & vue-cli & element UI创建vue单页应用

    基于node npm & vue-cli & element UI创建vue单页应用 开发环境   Win 10   node-v10.15.3-x64.msi 下载地址: https ...

  8. Vue学习笔记【1】——什么是Vue.js

    什么是Vue.js Vue.js 是目前最火的一个前端框架,React是最流行的一个前端框架(React除了开发网站,还可以开发手机App, Vue语法也是可以用于进行手机App开发的,需要借助于We ...

  9. Vue学习笔记一:使用vue-cli 创建开发环境

    第一步:安装Node.js 点击此处下载    选择对应的安装包,进行安装. 第二步:安装淘宝镜像 有一个问题,使用 npm 会导致网速很慢,对于大陆用户,建议将 npm 的注册表源设置为国内的镜像, ...

随机推荐

  1. 小程序实践(一):主页tab选项实现

    官方文档 效果图: 实现底部Tab选项,只需要在项目根目录下的app.json下修改 如图: ----------------------------------------------------- ...

  2. Bitmap压缩图片

       代码实现: public class MainActivity extends AppCompatActivity { private ImageView img; @Override prot ...

  3. Android 7.0 新特性

    Android7.0提供新功能以提升性能.生产效率和安全性. 关于Android N的性能改进,Android N建立了先进的图形处理Vulkan系统,能少的减少对CPU的占用.与此同时,Androi ...

  4. (python)数据结构---元组

    一.描述 一个有序的元素组成的集合 元组是不可变的线性数据结构 二.元组的相关操作 1.元组元素的访问 索引不可超界,否则抛异常IndexError 支持正负索引 t = (2, 3) print(t ...

  5. vi中的全局替换

    一.基本语法 替换命令语法: :[addr]s/源字符串/目标字符串/[option] 全局替换: :%s/源字符串/目标字符串/g 参数说明: [addr]--表示检索范围,省略时表示当前行. &q ...

  6. monkeyrunner.bat运行python脚本/命令行

    http://luochunfeng163.blog.163.com/blog/static/1670092492014258914775/

  7. Python3中操作字符串str必须记住的几个方法

    几个Python的字符串常用内建函数 1.方法:Python3 isdigit()方法 描述:Python isdigit() 方法检测字符串是否只由数字组成. 语法:str.isdigit() 参数 ...

  8. Linux: yum配置说明

    下面是利用 man yum.conf 命令获取到的有关yum配置的说明: yum.conf(5) yum configuration file yum.conf(5) NAME yum.conf - ...

  9. 对Can We Make Operating Systems Reliable and Secure 的翻译

    摘要:微内核-相对于大内核(monolithic kernels)来说,由于它的 lower performance,长期以来被认为是不可接受的.而现在,由于它潜 在的高可靠性(higher reli ...

  10. firefox浏览器 插件--【维基百科+谷歌翻译】高级应用之 带图翻译

    [维基词典+谷歌翻译]插件地址: https://addons.mozilla.org/zh-CN/firefox/addon/google-dictionary-and-google-t/?src= ...