Skip to content

Commit 4d2897d

Browse files
committed
add pictures!
1 parent cc4d561 commit 4d2897d

File tree

10 files changed

+13
-3
lines changed

10 files changed

+13
-3
lines changed

source/guide/application.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Webpack and Browserify are more than just module bundlers, though. They both pro
1515

1616
In a typical Vue.js project we will be breaking up our code into many small components, and it would be nice to have each component encapsulate its CSS styles, template and JavaScript definition in the same place. As mentioned above, when using Webpack or Browserify, with proper source transforms we can write our components like this:
1717

18-
<img src="/images/vueify.png">
18+
<img src="/images/vue-component.png">
1919

2020
If you are into pre-processors, you can even do this:
2121

22-
<img src="/images/vueify_with_pre.png">
22+
<img src="/images/vue-component-with-pre-processors.png">
2323

2424
You can build these single-file Vue components with Webpack + [vue-loader](https://github.com/vuejs/vue-loader) or Browserify + [vueify](https://github.com/vuejs/vueify). It is recommended to use the Webpack setup because Webpack's loader API enables better file dependency tracking and caching if you are using pre-processors.
2525

source/guide/index.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Even if you are already familiar with some of these terms, it is recommended tha
1717

1818
## Concepts Overview
1919

20+
![MVVM](/images/mvvm.png)
21+
2022
### ViewModel
2123

2224
An object that syncs the Model and the View. In Vue.js, every Vue instance is a ViewModel. They are instantiated with the `Vue` constructor or its sub-classes:
@@ -47,14 +49,18 @@ A slightly modified plain JavaScript object.
4749
vm.$data // The Model
4850
```
4951

50-
In Vue.js, models are simply plain JavaScript objects, or **data objects**. You can manipulate their properties and Vue instances that are observing them will be notified of the changes. Vue.js achieves transparent reactivity by converting the properties on data objects into ES5 getter/setters. There's no need for dirty checking, nor do you have to explicitly signal Vue to update the View. Whenever the data changes, the View is updated on the next frame.
52+
In Vue.js, models are simply plain JavaScript objects, or **data objects**. Once an object is used as data inside a Vue instnace, it becomes **reactive**. You can manipulate their properties and Vue instances that are observing them will be notified of the changes. Vue.js achieves transparent reactivity by converting the properties on data objects into ES5 getter/setters. There's no need for dirty checking, nor do you have to explicitly signal Vue to update the View. Whenever the data changes, the View is updated on the next frame.
5153

5254
Vue instances proxy all properties on data objects they observe. So once an object `{ a: 1 }` has been observed, both `vm.$data.a` and `vm.a` will return the same value, and setting `vm.a = 2` will modify `vm.$data`.
5355

5456
The data objects are mutated in place, so modifying it by reference has the same effects as modifying `vm.$data`. This makes it possible for multiple Vue instances to observe the same piece of data. In larger applications it is also recommended to treat Vue instances as pure views, and externalize the data manipulation logic into a more discrete store layer.
5557

5658
One caveat here is that once the observation has been initiated, Vue.js will not be able to detect newly added or deleted properties. To get around that, observed objects are augmented with `$add`, `$set` and `$delete` methods.
5759

60+
Below is a high-level overview of how reactive updates are implemented in Vue.js:
61+
62+
![Data Observation](/images/data.png)
63+
5864
### Directives
5965

6066
Prefixed HTML attributes that tell Vue.js to do something about a DOM element.
@@ -107,6 +113,8 @@ Now before the div's textContent is updated, the `message` value will first be p
107113

108114
### Components
109115

116+
![Component Tree](/images/components.png)
117+
110118
In Vue.js, every component is simply a Vue instance. Components form a nested tree-like hierarchy that represents your application interface. They can be instantiated by a custom constructor returned from `Vue.extend`, but a more declarative approach is registering them with `Vue.component(id, constructor)`. Once registered, they can be declaratively nested in other Vue instance's templates in the form of custom elements:
111119

112120
``` html

themes/vue/source/css/page.styl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ $header-height = 40px
160160
padding 12px 24px
161161
display inline-block
162162
vertical-align middle
163+
img
164+
max-width 100%
163165
span.light
164166
color $light
165167
span.info
15.9 KB
Loading

themes/vue/source/images/data.png

98.2 KB
Loading

themes/vue/source/images/mvvm.png

43 KB
Loading
Loading
124 KB
Loading

themes/vue/source/images/vueify.png

-50.2 KB
Binary file not shown.
-110 KB
Binary file not shown.

0 commit comments

Comments
 (0)