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
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.
107
107
108
108
Here is an example:
109
109
@@ -126,8 +126,6 @@ export default {
126
126
// Threads list
127
127
// This will update the 'threads' array property on the Vue instance
128
128
// 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
131
129
threads () {
132
130
// Here you can use Meteor reactive sources
133
131
// like cursors or reactive vars
@@ -139,23 +137,29 @@ export default {
139
137
// Selected thread
140
138
// This will update the 'selectedThread' object property on component
141
139
selectedThread () {
140
+
// You can also use Vue reactive data inside
142
141
returnThreads.findOne(this.selectedThreadId)
143
142
}
144
143
}
145
144
})
146
145
```
147
146
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`).
149
148
150
149
Use the reactive data in the template:
151
150
152
151
153
152
```html
154
153
<!-- Thread list -->
155
-
<thread-itemv-for="thread in threads":data="thread":selected="thread._id === selectedThreadId"@select="selectThread(thread._id)"></thread-item>
0 commit comments