You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -182,7 +182,7 @@ Example inehriting individual properties (using the same data):
182
182
183
183
## Literal Directives
184
184
185
-
> Literal directives treat their attribute value as a plain string; they do not attempt to bind themselves to anything. All they do is executing the `bind()` function with the string value once. Literal directives accept mustache expressions inside their value, but these expressions will be evaludated only once on first compile and do not react to data changes.
185
+
> Literal directives treat their attribute value as a plain string; they do not attempt to bind themselves to anything. All they do is executing the `bind()` function with the string value once. Literal directives accept mustache expressions inside their value, but these expressions will be evaluated only once on first compile and do not react to data changes.
186
186
187
187
### v-component
188
188
@@ -212,7 +212,7 @@ For details, see [the guide](/guide/transitions.html#JavaScript_Functions).
212
212
213
213
### v-transition
214
214
215
-
Notify Vue.js to apply transition CSS classes to this element. The transition classes are applied when certain transition-triggering directives modifies the element, or when the ViewModel's DOM manipulation methods are called.
215
+
Notify Vue.js to apply transition CSS classes to this element. The transition classes are applied when certain transition-triggering directives modify the element, or when the ViewModel's DOM manipulation methods are called.
216
216
217
217
For details, see [the guide](/guide/transitions.html#Css_Transitions).
218
218
@@ -224,7 +224,7 @@ For details, see [the guide](/guide/transitions.html#Css_Animations).
224
224
225
225
### v-pre
226
226
227
-
Skip compilation for this element and all its children. Skipping large amount of nodes with no directives on them can speed up compilation.
227
+
Skip compilation for this element and all its children. Skipping large numbers of nodes with no directives on them can speed up compilation.
Copy file name to clipboardExpand all lines: source/api/filters.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -114,7 +114,7 @@ Finally, you can use quotes to indicate literal arguments:
114
114
- this filter only works in `v-repeat`
115
115
- this is a computed filter
116
116
117
-
Sort `v-repeat`'s displayed result. The `sorKey` argument is a property key on the context ViewModel. The value of that property will be used as the key to sort the Array items with. The optional `reverseKey` argument is also a property key on the context ViewModel, but the value's truthiness will determine whether the result should be reversed.
117
+
Sort `v-repeat`'s displayed result. The `sortKey` argument is a property key on the context ViewModel. The value of that property will be used as the key to sort the Array items with. The optional `reverseKey` argument is also a property key on the context ViewModel, but the value's truthiness will determine whether the result should be reversed.
Copy file name to clipboardExpand all lines: source/api/global-methods.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -152,7 +152,7 @@ Will result in:
152
152
153
153
-**callback**`Function`
154
154
155
-
Vue.js batches view updates and execute them all asynchronously. It uses `requestAnimationFrame` if available and fallsback to `setTimeout(fn, 0)`. This method calls the callback after the next view update, which can be useful when you want to wait until the view has been updated.
155
+
Vue.js batches view updates and executes them all asynchronously. It uses `requestAnimationFrame` if available and falls back to `setTimeout(fn, 0)`. This method calls the callback after the next view update, which can be useful when you want to wait until the view has been updated.
Copy file name to clipboardExpand all lines: source/api/index.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ type: api
3
3
order: 1
4
4
---
5
5
6
-
The `Vue` Class is the core of vue.js. It is a constructor that allows you to create ViewModel instances. Creating a ViewModel instance is straightforward:
6
+
The `Vue` Class is the core of Vue.js. It is a constructor that allows you to create ViewModel instances. Creating a ViewModel instance is straightforward:
7
7
8
8
```js
9
9
var vm =newVue({ /* options */ })
@@ -15,10 +15,10 @@ During the compilation phase, Vue.js walks through the DOM and compiles the dire
15
15
16
16
Each ViewModel instance has an associated DOM element `$el`, which is essentially the V in MVVM. It also has an associated JavaScript object `$data`, which is essentially the M in MVVM. Changing the M results in updates in the V. For two-way bindings, inputs in the V results in changes in the M. For more details check out [Instance Properties](/api/instance-properties.html).
17
17
18
-
ViewModel instances proxies access to their `$data` objects, so if you have `vm.$data.msg` you can also access it as `vm.msg`. This might look a bit magical, but is totally optional. You can stick to `vm.$data.msg` for more explicit data access. However it is still important to notice the difference between `vm` and `vm.$data`, since the former cannot be observed by other ViewModels as data.
18
+
ViewModel instances proxy access to their `$data` objects, so if you have `vm.$data.msg` you can also access it as `vm.msg`. This might look a bit magical, but is totally optional. You can stick to `vm.$data.msg` for more explicit data access. However it is still important to notice the difference between `vm` and `vm.$data`, since the former cannot be observed by other ViewModels as data.
19
19
20
20
It's also worth noting that data objects do not necessarily belong to a single ViewModel - multiple ViewModels can observe the same piece of data, whether directly as `$data` or nested under it. This is useful when multiple components need to react to a shared global state object.
21
21
22
-
Each ViewModel instance also has a number of [Instance Methods](/api/instance-methods.html) which covers data observation, event communication and dom manipulation.
22
+
Each ViewModel instance also has a number of [Instance Methods](/api/instance-methods.html) which cover data observation, event communication and DOM manipulation.
23
23
24
24
Finally, the `Vue` constructor itself also holds several [Global Methods](/api/global-methods.html), which allow you to extend the `Vue` class, configure global settings and register global custom assets such as components, directives, filters and more.
Copy file name to clipboardExpand all lines: source/api/instance-methods.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -78,11 +78,11 @@ Attach a one-time only listener for an event.
78
78
-**event**`String`*optional*
79
79
-**callback**`Function`*optional*
80
80
81
-
If no arguments are given, stop listening for all events; If only the event is given, remove all callbacks for that event; If both event and callback are given, remove that specific callback only.
81
+
If no arguments are given, stop listening for all events; if only the event is given, remove all callbacks for that event; if both event and callback are given, remove that specific callback only.
82
82
83
83
## DOM Manipulation
84
84
85
-
> All vm DOM manipulation methods work like their jQuery counterparts - except they also trigger vue.js transitions if there are any declared on vm's `$el`. For more details on transitions see [Adding Transition Effects](/guide/transitions.html).
85
+
> All vm DOM manipulation methods work like their jQuery counterparts - except they also trigger Vue.js transitions if there are any declared on vm's `$el`. For more details on transitions see [Adding Transition Effects](/guide/transitions.html).
Copy file name to clipboardExpand all lines: source/api/instantiation-options.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ vm.a // 3
33
33
34
34
The object must be JSON-compliant (no circular references). You can use it just like an ordinary object, and it will look exactly the same when serialized with `JSON.stringify`. You can also share it between multiple ViewModels.
35
35
36
-
<pclass="tip">Under the hood, vue.js attaches a hidden property `__emitter__` and recursively converts the object's non-function properties into getters and setters that trigger events when called. Properties with keys that starts with `$` or `_` are skipped.</p>
36
+
<pclass="tip">Under the hood, Vue.js attaches a hidden property `__emitter__` and recursively converts the object's non-function properties into getters and setters that trigger events when called. Properties with keys that starts with `$` or `_` are skipped.</p>
37
37
38
38
### methods
39
39
@@ -131,7 +131,7 @@ A string template to be inserted into `vm.$el`. Any existing markup inside `vm.$
131
131
132
132
If it starts with `#` it will be used as a querySelector and use the selected element's innerHTML and the template string. This allows the use of the common `<script type="x-template">` trick to include templates.
133
133
134
-
<pclass="tip">Vue.js uses DOM-based templating. The compiler walks through DOM elements and looks for directives and creates data bindings. This means all vue.js templates are parsable HTML that can be converted into actual DOM elements by the browser. Vue.js converts string templates into DOM fragments so they can be cloned when creating more ViewModel instances. If you want your templates to be valid HTML, you can configure the directive prefix to start with `data-`.</p>
134
+
<pclass="tip">Vue.js uses DOM-based templating. The compiler walks through DOM elements and looks for directives and creates data bindings. This means all Vue.js templates are parsable HTML that can be converted into actual DOM elements by the browser. Vue.js converts string templates into DOM fragments so they can be cloned when creating more ViewModel instances. If you want your templates to be valid HTML, you can configure the directive prefix to start with `data-`.</p>
135
135
136
136
### replace
137
137
@@ -217,7 +217,7 @@ These are private assets that will be available only to this ViewModel and its c
217
217
218
218
-**Type:**`Object`
219
219
220
-
An hash of directives to be made available to the ViewModel. For details on how to write a custom directive, see [Writing Custom Directives](/guide/directives.html#Writing_a_Custom_Directive).
220
+
A hash of directives to be made available to the ViewModel. For details on how to write a custom directive, see [Writing Custom Directives](/guide/directives.html#Writing_a_Custom_Directive).
221
221
222
222
### filters
223
223
@@ -263,6 +263,6 @@ This option is useful when you need to manually manage the lifecycle of nested V
263
263
-**Type:**`Boolean`
264
264
-**Default:**`false`
265
265
266
-
Whether to trigger `v-model` updates only on `change`event (hit enter or lose focus) or on every `input` event (on every keystroke).
266
+
Whether to trigger `v-model` updates only on `change`events (hit enter or lose focus) or on every `input` event (on every keystroke).
267
267
268
268
**Note:** since 0.10.5 child ViewModels will inherit their parents' `lazy` option if they don't have the option set on themselves.
Copy file name to clipboardExpand all lines: source/guide/application.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ Alternatively, [Browserify](http://browserify.org/) is another excellent CommonJ
17
17
18
18
## Modularization
19
19
20
-
Component as a built tool not only deals with JavaScript; it can also build CSS, templates and other assets. With builder hooks it can also pre-process files written in non-native formats, e.g. CoffeeScript, SASS and Stylus. Therefore it is possible to deliver highly self-contained components that encapsulates template structure, JavaScript logic and CSS presentation at the same time. A simple example can be found [here](https://github.com/vuejs/vue-component-example/tree/master/src/components/a).
20
+
Component as a build tool not only deals with JavaScript; it can also build CSS, templates and other assets. With builder hooks it can also pre-process files written in non-native formats, e.g. CoffeeScript, SASS and Stylus. Therefore it is possible to deliver highly self-contained components that encapsulate template structure, JavaScript logic and CSS presentation at the same time. A simple example can be found [here](https://github.com/vuejs/vue-component-example/tree/master/src/components/a).
21
21
22
22
Similar modularization can be achieved in Browserify too, with transform plugins such as [partialify](https://github.com/bclinkinbeard/partialify). A simple setup example can be found [here](https://github.com/vuejs/vue-browserify-example).
23
23
@@ -47,11 +47,11 @@ The `home` component will be rendered in place of `v-view`. When `currentView`'s
47
47
48
48
<pclass="tip">`v-view` will replace the element it's bound to with the new instantiated VM's element, so avoid using it on your root element.</p>
49
49
50
-
With `v-view` it's very easy to leverage standalone routing libraries such as [Page.js](https://github.com/visionmedia/page.js) and [Director](https://github.com/flatiron/director). There is plan to provide a vue-router component that integrates with Vue.js for easier routing and deep linking.
50
+
With `v-view` it's very easy to leverage standalone routing libraries such as [Page.js](https://github.com/visionmedia/page.js) and [Director](https://github.com/flatiron/director). There is a plan to provide a vue-router component that integrates with Vue.js for easier routing and deep linking.
51
51
52
52
## Communication with Server
53
53
54
-
All Vue.js ViewModels can have their raw `$data` directly serialized with `JSON.stringify()` with no additional effort. You can use any Ajax component you like, for example [SuperAgent](https://github.com/visionmedia/superagent). It also plays nicely with no-backend services such as Firebase. In addition there is plan to provide a vue-resource component that resembles Angular's `$resource`, to make interfacing with a REST API easier.
54
+
All Vue.js ViewModels can have their raw `$data` directly serialized with `JSON.stringify()` with no additional effort. You can use any Ajax component you like, for example [SuperAgent](https://github.com/visionmedia/superagent). It also plays nicely with no-backend services such as Firebase. In addition there is a plan to provide a vue-resource component that resembles Angular's `$resource`, to make interfacing with a REST API easier.
Copy file name to clipboardExpand all lines: source/guide/composition.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ order: 10
5
5
6
6
## Registering a Component
7
7
8
-
Vue.js allows you to treat registered ViewModel constructors as reusable components that is conceptually similar to [Web Components](http://www.w3.org/TR/components-intro/), without requiring any polyfills. To register a component, first create a subclass constructor of Vue using `Vue.extend()`, then use the global `Vue.component()` method to register that constructor:
8
+
Vue.js allows you to treat registered ViewModel constructors as reusable components that are conceptually similar to [Web Components](http://www.w3.org/TR/components-intro/), without requiring any polyfills. To register a component, first create a subclass constructor of Vue using `Vue.extend()`, then use the global `Vue.component()` method to register that constructor:
9
9
10
10
```js
11
11
// Extend Vue to get a reusable constructor
@@ -44,7 +44,7 @@ If you prefer, components can also be used in the form of a custom element tag:
44
44
45
45
It is important to understand the difference between `Vue.extend()` and `Vue.component()`. Since `Vue` itself is a constructor, `Vue.extend()` is a **class inheritance method**. Its task is to create a sub-class of `Vue` and return the constructor. `Vue.component()`, on the other hand, is an **asset registration method** similar to `Vue.directive()` and `Vue.filter()`. Its task is to associate a given constructor with a string ID so Vue.js can pick it up in templates. When directly passing in options to `Vue.component()`, it calls `Vue.extend()` under the hood.
46
46
47
-
Vue.js supports two different API paradigms: the class-based, imperative, Backbone style API, and the markup-based, declarative, Web Components style API. If you are confused, think about how you can create an image element with `new Image()`, or with an `<img>` tag. Both are useful in its own right and Vue.js tries to provide both for maximum flexibility.
47
+
Vue.js supports two different API paradigms: the class-based, imperative, Backbone style API, and the markup-based, declarative, Web Components style API. If you are confused, think about how you can create an image element with `new Image()`, or with an `<img>` tag. Each is useful in its own right and Vue.js tries to provide both for maximum flexibility.
48
48
49
49
## Data Inheritance
50
50
@@ -280,7 +280,7 @@ var MyComponent = Vue.extend({
280
280
})
281
281
```
282
282
283
-
Alternatively, you can add private assets to an existing Component constructor using a chaining API similar to the global asset registeration methods:
283
+
Alternatively, you can add private assets to an existing Component constructor using a chaining API similar to the global asset registration methods:
284
284
285
285
```js
286
286
MyComponent
@@ -294,7 +294,7 @@ MyComponent
294
294
295
295
### Single insertion point
296
296
297
-
When creating reusable components, we often need to access and reuse the original content in the hosting element, which are not part of the component. Vue.js implements a content insertion mechanism that is compatible with the current Web Components spec draft, using the special `<content>` element to serve as insertion points for the original content. When there is only one `<content>` tag with no attributes, the entire original content will be inserted at its position in the DOM and replaces it. Anything originally inside the `<content>` tags are considered **fallback content**. Fallback content will only be displayed if the hosting element is empty and has no content to be inserted. For example:
297
+
When creating reusable components, we often need to access and reuse the original content in the hosting element, which are not part of the component. Vue.js implements a content insertion mechanism that is compatible with the current Web Components spec draft, using the special `<content>` element to serve as insertion points for the original content. When there is only one `<content>` tag with no attributes, the entire original content will be inserted at its position in the DOM and replaces it. Anything originally inside the `<content>` tags is considered **fallback content**. Fallback content will only be displayed if the hosting element is empty and has no content to be inserted. For example:
0 commit comments