Skip to content

Commit 3fa6889

Browse files
author
Guillaume Chau
committed
docs: update
1 parent 428587c commit 3fa6889

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,15 @@ Vue.config.meteor.subscribe = function(...args) {
103103

104104
#### Reactive data
105105

106-
You can make your component `data` properties update from any Meteor reactive sources (like collections or session) by putting an object for each property in the `meteor` object. The object key is the name of the property (it shouldn't start with `$`), and the value is a function that returns the result.
106+
You can add reactive properties that update from any Meteor reactive sources (like collections or session) by putting an object for each property in the `meteor` object. The object key is the name of the property (it shouldn't start with `$`), and the value is a function that returns the result.
107107

108108
Here is an example:
109109

110110
```js
111111
export default {
112112
data() {
113113
return {
114-
selectedThreadId: null,
115-
// We can init the property value in the data() component hook
116-
threads: [],
117-
selectedThread: null
114+
selectedThreadId: null
118115
}
119116
},
120117
meteor: {
@@ -124,8 +121,7 @@ export default {
124121
'threads': []
125122
},
126123
// Threads list
127-
// This will update the 'threads' array property on the Vue instance
128-
// that we set in the data() hook earlier
124+
// You can access tthe result with the 'threads' property on the Vue instance
129125
threads () {
130126
// Here you can use Meteor reactive sources
131127
// like cursors or reactive vars
@@ -135,7 +131,6 @@ export default {
135131
})
136132
},
137133
// Selected thread
138-
// This will update the 'selectedThread' object property on component
139134
selectedThread () {
140135
// You can also use Vue reactive data inside
141136
return Threads.findOne(this.selectedThreadId)
@@ -144,8 +139,6 @@ export default {
144139
})
145140
```
146141

147-
You can skip the data initialization (the default value will be `undefined`).
148-
149142
Use the reactive data in the template:
150143

151144

0 commit comments

Comments
 (0)