vue-meteor
vue-meteor copied to clipboard
A rewrite of vue-blaze-template
I started working on fixing #223 and I ended up with a complete rewrite of the package. I think it is much better now. :-) It is using a custom component to render templates, like:
<blaze-template template="blaze-template" :data="{dataContext}"></blaze-template>
This example also binds the data context to the template. So you can pass data from Vue to Blaze template.
You can bind the property to make template dynamic:
<blaze-template :template="blaze-template"></blaze-template>
You can use a different tag for the wrapper tag (default is div):
<blaze-template template="blaze-template" tag="span"></blaze-template>
Any extra arguments are passed on to wrapper tag:
<blaze-template template="blaze-template" class="foobar"></blaze-template>
And if you put any content between start and end tag, it is passed to the Blaze template as Template.contentBlock:
<blaze-template template="blaze-block-helper">
<p>This is slot content from Vue: {{slotValue}}</p>
</blaze-template>
And it is reactive as well. So slotValue comes from outside Vue component, but it is rendered inside Blaze block helper template.
And from Blaze, you can make a link to change Vue router's page with a block helper like:
{{#RouterLink to="/"}}Go to Home{{/RouterLink}}
See it in action by running this repository.
Do you want to publish mitar:vue-blaze or so package and then make a link to it from here?
Hm, I was thinking that we could merge my work with your existing work somehow? Also the tracker work and so on. We should discuss how should this be done. One option is to keep things separate, but we could also see if this could be combined. What do you think?
Published repository here and on Atmosphere under vuejs:blaze-integration.