From af3994d3e4e4ef108c6672a10eae7dd9ca064599 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Sun, 13 May 2018 20:33:52 +0200 Subject: [PATCH] docs: updates --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8321ce6..fa851ae 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ Vue.config.meteor.subscribe = function(...args) { #### Reactive data -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. +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. Here is an example: @@ -126,8 +126,6 @@ export default { // Threads list // This will update the 'threads' array property on the Vue instance // that we set in the data() hook earlier - // You can use a function directly if you don't need - // parameters coming from the Vue instance threads () { // Here you can use Meteor reactive sources // like cursors or reactive vars @@ -139,23 +137,29 @@ export default { // Selected thread // This will update the 'selectedThread' object property on component selectedThread () { + // You can also use Vue reactive data inside return Threads.findOne(this.selectedThreadId) } } }) ``` -You can skip the data initialization (the default value will be `null`). +You can skip the data initialization (the default value will be `undefined`). Use the reactive data in the template: ```html - + - + ```