vue acquaintance
vue special characters and their meanings:
- @click: the equivalent of v-on: click = "function", bind click event.
- The role of com directory
- : Class: v-bind: Abbreviation class = "class variables" a, class of objects or an array of values supported.
- v-bind: {} {} corresponding to
- IF-V :
v-if = "show"
; "Show" is a boolean, determines whether the host element - v-else: a pre-siblings must have v-if or v-else-if
- v-else-if: a former siblings must have a v-if or v-else-if
- v-html: updated element innerHTML
- for-v:
v-for = "(todoItem,index) in todoList"
, traversing the rendering of each todoList - v-modal:
<input v-model="message">
form input values, variable replacement message - Content attribute style tags can contain? scoped role
- filter Usage: Filters
- $ Mount: a manually mount instance unmounted
- $ Emit:. $ Emit events can be triggered by vm. The callback function will receive all incoming events triggered additional function parameters.
- vm.$on( event, callback )
- Distinguished attribute names, attribute names @: Component traditional values,
- data () {} wording
- Vue.use()
- form-data
- mounted: loaded
- methods: the method defined events
to sum up
- v-: command syntax v-指令类型 = String, you must add it to an element
- data defined in the new data is available through out directly access the app Vue example, as app.todoList, instead app.data.todoList
- Vue assembly name not capitalized, which is different and React. Cases
<todo-list/>
, while React must be written<TodoList>
, can not appear "-." - $ Is the beginning of the Vue instance properties and methods exposed. As vm. $ Data, vm. $ El
- v-on is an abbreviation @
- v-bind abbreviations are:
- Do not use the arrows on the Options attribute or function callback;
- The most used is a single-file assembly
Reference
Vue official documents