2018-02-26 vue学习

2018-02-27  本文已影响0人  等花开_8e16

1.一个重要的事情值得注意,关注点分离不等于文件类型分离。在现代 UI 开发中,我们已经发现相比于把代码库分离成三个大的层次并将其相互交织起来,把它们划分为松散耦合的组件再将其组合起来更合理一些。在一个组件里,其模板、逻辑和样式是内部耦合的,并且把他们搭配在一起实际上使得组件更加内聚且更可维护。

2. npm 学习

What is npm?

anserw:npm consists of three distinct components:

the website ---The website is the primary way developers discover packages, set up profiles, and manage other aspects of their npm experience.

the registry---The registry is a large database of information about packages.

the Command Line Interface (CLI)---The CLI runs from a terminal. This is how most developers interact with npm.

How to Install npm & Manage npm Versions

npm is written in Node.js

中间管理node.js和npm版本的nvm那个是个什么鬼,看了半天没看懂,之后用到的话再查资料吧,进度太慢了

Working with package.json

 npm init  -y

"dependencies": These packages are required by your application in production.

"devDependencies": These packages are only needed for development and testing.

To add an entry to your package.json's dependencies:

npm install --save

To add an entry to your package.json's devDependencies:

npm install --save-dev

Managing dependency versions

npm uses Semantic Versioning(语义化版本统计-http://blog.csdn.net/vblittleboy/article/details/48523015), or, as we often refer to it, SemVer, to manage versions and ranges of versions of packages.

npm update [-g] [<pkg>...]

npm-update 不用根本看不懂英文文档系列,以后再深入研究吧,对自己完全无语

How to Uninstall Local Packages

To remove a package from your node_modules directory, use:

npm uninstall :

npm uninstall lodash

To remove it from the dependencies in package.json, you will need to use the save flag:

npm uninstall --save lodash

Note: if you installed the package as a "devDependency" (i.e. with --save-dev) then --save won't remove it from package.json. You have to use --save-dev to uninstall it.

Note: if you installed the package as a "devDependency" (i.e. with --save-dev) then --save won't remove it from package.json. You have to use --save-dev to uninstall it

To confirm that npm uninstall worked correctly

ls node_modules on Unix systems such as "OSX"

How to Install Global Packages

npm install -g

How to Update Global Packages

npm update -g

How to uninstall global packages

npm uninstall -g  <package>

To upgrade, run: npm install npm@latest -g

阅读英文文档大部分靠蒙!!!

3.单词积累

   Verify - 核实

   semantic - 语义的,语义学的

    aliases - 别名

4.mac os

   cd ~/ 进入根目录

   shift+g vi编辑模式下跳转到文件末尾

上一篇 下一篇

猜你喜欢

热点阅读