zhouzhuojie / meteor-vue

Vue for Meteor
130 stars 8 forks source link

How to use the vm data attribute as template helpers' parameter? #9

Closed JohnSmith0602 closed 9 years ago

JohnSmith0602 commented 9 years ago

Here's the sample code:

<span>[[name]]</span>  // It has a value.
<span>{{helper [[name]]}}</span>

Meteor says the syntax is wrong; yet if I use {{helper name}}, the name parameter is undefined.

What can I do then? Thanks.

zhouzhuojie commented 9 years ago

tl;dr You can't.

template is rendered before any vue instance, so it's literally [[name]] in the html when loading helper functions. What you need to do is just to adopt one, either use Blaze or Vue, try not to mix both.

JohnSmith0602 commented 9 years ago

Thanks.