diff --git a/src/v2/cookbook/form-validation.md b/src/v2/cookbook/form-validation.md index f21e2ae8b8..e7133dd0a4 100644 --- a/src/v2/cookbook/form-validation.md +++ b/src/v2/cookbook/form-validation.md @@ -6,6 +6,8 @@ order: 3 ## Base Example +
Watch a free lesson on Vue School
+ Form validation is natively supported by the browser, but sometimes different browsers will handle things in a manner which makes relying on it a bit tricky. Even when validation is supported perfectly, there may be times when custom validations are needed and a more manual, Vue-based solution may be more appropriate. Let's begin with a simple example. Given a form of three fields, make two required. Let's look at the HTML first: diff --git a/src/v2/guide/class-and-style.md b/src/v2/guide/class-and-style.md index 2c40d5033c..333ae884c3 100644 --- a/src/v2/guide/class-and-style.md +++ b/src/v2/guide/class-and-style.md @@ -7,6 +7,7 @@ order: 6 A common need for data binding is manipulating an element's class list and its inline styles. Since they are both attributes, we can use `v-bind` to handle them: we only need to calculate a final string with our expressions. However, meddling with string concatenation is annoying and error-prone. For this reason, Vue provides special enhancements when `v-bind` is used with `class` and `style`. In addition to strings, the expressions can also evaluate to objects or arrays. ## Binding HTML Classes +
Watch a free video lesson on Vue School
### Object Syntax diff --git a/src/v2/guide/components-dynamic-async.md b/src/v2/guide/components-dynamic-async.md index 5d589d1906..6c3daabb43 100644 --- a/src/v2/guide/components-dynamic-async.md +++ b/src/v2/guide/components-dynamic-async.md @@ -201,6 +201,8 @@ Check out more details on `` in the [API reference](../api/#keep-ali ## Async Components +
Watch a free video lesson on Vue School
+ In large applications, we may need to divide the app into smaller chunks and only load a component from the server when it's needed. To make that easier, Vue allows you to define your component as a factory function that asynchronously resolves your component definition. Vue will only trigger the factory function when the component needs to be rendered and will cache the result for future re-renders. For example: ``` js diff --git a/src/v2/guide/components-registration.md b/src/v2/guide/components-registration.md index 8c4404aa35..b14ee344f9 100644 --- a/src/v2/guide/components-registration.md +++ b/src/v2/guide/components-registration.md @@ -6,6 +6,8 @@ order: 101 > This page assumes you've already read the [Components Basics](components.html). Read that first if you are new to components. +
Watch a free video lesson on Vue School
+ ## Component Names When registering a component, it will always be given a name. For example, in the global registration we've seen so far: diff --git a/src/v2/guide/components.md b/src/v2/guide/components.md index 038d803e74..35dc38b4db 100644 --- a/src/v2/guide/components.md +++ b/src/v2/guide/components.md @@ -4,6 +4,8 @@ type: guide order: 11 --- +
Watch a free video course on Vue School
+ ## Base Example Here's an example of a Vue component: diff --git a/src/v2/guide/custom-directive.md b/src/v2/guide/custom-directive.md index a62499665a..03d0c484ad 100644 --- a/src/v2/guide/custom-directive.md +++ b/src/v2/guide/custom-directive.md @@ -6,6 +6,8 @@ order: 302 ## Intro +
Watch a free video lesson on Vue School
+ In addition to the default set of directives shipped in core (`v-model` and `v-show`), Vue also allows you to register your own custom directives. Note that in Vue 2.0, the primary form of code reuse and abstraction is components - however there may be cases where you need some low-level DOM access on plain elements, and this is where custom directives would still be useful. An example would be focusing on an input element, like this one: {% raw %} diff --git a/src/v2/guide/instance.md b/src/v2/guide/instance.md index 268bab16d2..87ec1874a0 100644 --- a/src/v2/guide/instance.md +++ b/src/v2/guide/instance.md @@ -123,6 +123,8 @@ In the future, you can consult the [API reference](../api/#Instance-Properties) ## Instance Lifecycle Hooks +
Watch a free lesson on Vue School
+ Each Vue instance goes through a series of initialization steps when it's created - for example, it needs to set up data observation, compile the template, mount the instance to the DOM, and update the DOM when data changes. Along the way, it also runs functions called **lifecycle hooks**, giving users the opportunity to add their own code at specific stages. For example, the [`created`](../api/#created) hook can be used to run code after an instance is created: diff --git a/src/v2/guide/single-file-components.md b/src/v2/guide/single-file-components.md index c7de7d32a3..ef4f1d101d 100644 --- a/src/v2/guide/single-file-components.md +++ b/src/v2/guide/single-file-components.md @@ -6,6 +6,8 @@ order: 401 ## Introduction +
Watch a free video lesson on Vue School
+ In many Vue projects, global components will be defined using `Vue.component`, followed by `new Vue({ el: '#container' })` to target a container element in the body of every page. This can work very well for small to medium-sized projects, where JavaScript is only used to enhance certain views. In more complex projects however, or when your frontend is entirely driven by JavaScript, these disadvantages become apparent: diff --git a/themes/vue/source/css/_scrimba.styl b/themes/vue/source/css/_scrimba.styl index 2a5d16e966..be2cd296a5 100644 --- a/themes/vue/source/css/_scrimba.styl +++ b/themes/vue/source/css/_scrimba.styl @@ -1,4 +1,4 @@ -.scrimba +.scrimba, .vueschool background-color #e7ecf3 padding 1em 1.25em border-radius 2px