zhouzhuojie / meteor-vue

Vue for Meteor
130 stars 8 forks source link

Initialize reactive data before compilation. Set merge strategy. #27

Closed almini closed 8 years ago

zhouzhuojie commented 8 years ago

Thanks so much for the pr! Can you explain what does the hook function do here? Also, you may want to pass the unit tests.

almini commented 8 years ago

Thanks for pointing out the test cases. Now it's fixed. The hook function just executes the code right before the 'created' hook, before the compilation starts. I did this to have the computed value in the template right from the beginning. This is useful if you f.e. want to call a method on an object.