Skip to content

Commit af3994d

Browse files
author
Guillaume Chau
committed
docs: updates
1 parent c8f473b commit af3994d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ 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.
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.
107107

108108
Here is an example:
109109

@@ -126,8 +126,6 @@ export default {
126126
// Threads list
127127
// This will update the 'threads' array property on the Vue instance
128128
// that we set in the data() hook earlier
129-
// You can use a function directly if you don't need
130-
// parameters coming from the Vue instance
131129
threads () {
132130
// Here you can use Meteor reactive sources
133131
// like cursors or reactive vars
@@ -139,23 +137,29 @@ export default {
139137
// Selected thread
140138
// This will update the 'selectedThread' object property on component
141139
selectedThread () {
140+
// You can also use Vue reactive data inside
142141
return Threads.findOne(this.selectedThreadId)
143142
}
144143
}
145144
})
146145
```
147146

148-
You can skip the data initialization (the default value will be `null`).
147+
You can skip the data initialization (the default value will be `undefined`).
149148

150149
Use the reactive data in the template:
151150

152151

153152
```html
154153
<!-- Thread list -->
155-
<thread-item v-for="thread in threads" :data="thread" :selected="thread._id === selectedThreadId" @select="selectThread(thread._id)"></thread-item>
154+
<ThradItem
155+
v-for="thread in threads"
156+
:data="thread"
157+
:selected="thread._id === selectedThreadId"
158+
@select="selectThread(thread._id)"
159+
/>
156160

157161
<!-- Selected thread -->
158-
<thread v-if="selectedThread" :id="selectedThreadId"></thread>
162+
<Thread v-if="selectedThread" :id="selectedThreadId"/>
159163
```
160164

161165

0 commit comments

Comments
 (0)