Vue basic commands and webpack to create Vue projects

Vue basic commands

v-bind instruction

The function of the v-bind instruction is to bind attributes to the element
. The complete wording is v-bind: attribute name. If you
abbreviate it, you can omit v-bind directly, and only keep: attribute name

v-for

The function of the v-for instruction is to generate a list structure based on data.
Arrays are often used in combination with v-for. The
syntax is (item, index) in. The data
item and index can be used in conjunction with other instructions.
The update of the array length will be synchronized to the page. Responsive

v-on

Pass custom parameters, event modifiers,
document portal
link: link .
The method of event binding is written in the form of a function call, and custom parameters can be passed in. When
defining a method, you need to define formal parameters to receive the incoming actual parameter
event followed by
Above , the modifier can limit the event. Enter can limit the triggered key to enter

v-model

Get and set the value of the form element (two-way data binding) The function of the
v-model command is to conveniently set and get the value of the form element. The
bound data will be associated with
the value of the form element. The value of the bound data form element

axios

Powerful network request library
Link:
Document Portal: https://github.com/axios/axios
axios must be imported before it can be used.
Use the get or post method to send the corresponding request

webpack

Create a webpack project Syntax
$ vue init webpack my-project

? Project name vuetest    //项目名称
? Project description A Vue.js project    //项目描述默认回车
? Author                        //作者
? Vue build standalone      //打包方式standalone
? Install vue-router? Yes      //是否创建路由,学习初期暂时不需要
? Use ESLint to lint your code? No       //是否使用ESLint检测你的代码。建议:No
? Pick an ESLint preset Standard
? Set up unit tests Yes      //是否安装单元测试。建议:No
? Pick a test runner jest      
? Setup e2e tests with Nightwatch? Yes   //是否安装E2E测试框架NightWatch(E2E(End To End),就是所谓的“用户真实场景”)。建议:No
? Should we run `npm install` for you after the project has been created? (recommended) npm     //项目创建后是否要为你运行“npm install”?这里按照推荐,选择包管理工具。建议:yes use npm

Start webpack project syntax
npm run dev

Guess you like

Origin blog.csdn.net/yang13676084606/article/details/108326265