Table of Contents
Vue.js 2.0 Basics. Create Vue.js object - This creates new Vue object that targets the id of the div tag. You can then data bind the keyword property. Hey there DEV.to community! So this is the second part of my previous Vue cheat sheet. Some descriptions and code samples are from Vue.js official website.
- 8. Vue CLI
- 9. Slots
- 16. Transitions
- 17. HTTP: vue-resource
- 18. Routing
An unopinionated visual filtering component for Vue Apr 19, 2021 Input with validation component for Vue 2.x Apr 18, 2021 Vue component to create popups and tooltips Apr 17, 2021 A Simple And Customizable List For Vue.js Apr 16, 2021. Vue.js Complete API Cheat Sheet (Vue.js Tips and Tricks) View: Vue.js Tutorials (GitBook) View: Build, Enhance, Learn. With such a wide variety of available resources, there’s never been a better time to dive into JavaScript. Whether you want to master a. Global 2.2 2.2 Global Options Options Options 2.2 Options Options 2.2 Options 2.2 Methods Methods Methods Instance 2.2 2.1 html 2.1 Hooks html Built-In Modifiers Modifiers.
1 Events
2 Styling
3 Conditionals
4 Looping
5 Components
6 Vue lifecycle
Vue ←watch→ Virtual DOM ←update→ DOM
new Vue()
;.beforeCreate()
;.created()
;.beforeMount()
;.updated()
;.beforeUpdate()
;.beforeDestroy()
;.destroyed()
;
7 Development workflow
8 Vue CLI
Different templates: simple
, webpack-simple
, webpack
, browserify
/ browserify-simple
8.1 Example: webpack-simple
layout
9 Slots
Passing some content (i.e. DOM trees) from outside into a component?
Parent.vue
:
Child component:
9.1 Multiple slots: <slot name='>
In child.vue
:
In parent.vue
:
An unnamed slot is the default slot!
9.2 Optional <slot>
: slots with defaults
10 Dynamic components: <component>
An old component is destroyed on change!Although:
Hooks into <keep-alive>
lifecycle:
11 Forms
The .lazy
modifier: don't react on every little change, just on enter/blur:
Multiple bindings to the same name in data
make an array in data
automatically (useful for checkboxes, <input type='checkbox'></input>
).
– automatically switches the choice
value.
12 Using v-model
with components
Component:
13 Directives: v-..
Hooks:
bind(el, binding, vnode)
– Once directive is attached;inserted(el, binding, vnode)
– Inserted in parent node;update(el, binding, vnode, oldVnode)
– once component is updated (without children);componentUpdated(el, binding, vnode, oldVnode)
– (with children);unbind(el, binding, vnode)
Arguments for a directive:
Modifiers:
Registering directives locally:
Multiple modifiers values: pass an object
14 Filters
15 Mixins
16 Transitions
Download mac big sur. <transition name='*'>
elements.CSS classes:
*-enter
when forward animation starts;*-enter-active
when forward animation ends;*-leave
when reverse animation starts;*-leave-active
when reverse animation ends;
16.1appear
attribute
triggers animations on load.
16.2 Manual leave-enter classes:
16.3 Dynamic transition name
16.4 Multiple elements transitions
16.5 Transition JS hooks
17 HTTP: vue-resource
17.1 Setup
or
17.2 Importing vue-resource
17.3 Usage: simple example
17.4Vue.http.interceptors
hooks
17.5 Setting custom resources
17.6 URL templating
18 Routing
18.1 Setting up
Vue 3 Cheat Sheet
18.2 First route
routes.js
:
main.js
:
App.vue
:
Vue Js 3 Cheat Sheet
18.3 Routing modes (hash vs history)
'Seamless' mode: the server always returns index.html
on any request