I would like to use Vue (v2) to manage parts of an HTML page, but do it in such a way that if the user does not have javscript, they still get a nice page.
e.g. The server might output:
<div id="rootAppContainer">
...
<article is="foo" >
<h1>Something cool</h1>
<p>Here's a great article.</p>
</article>
...
</div>
Which is fine as a fallback. But I'd like Vue to mount the article and replace it with something better, e.g.
<article>
<p v-show="showTeaser" >{{teaser}}</p>
<div v-show="!showTeaser" >
<h1>{{title}}</h1>
<p>Here you go:</p>
<p>{{body}}</p>
</div>
</article>
To do this, I'd like to be able to parse the pre-vue content of the element that's getting mounted to extract the view-model's data that will then be formatted by its template.
I thought I could do this with lifecycle hooks, or the component's data method, but I can't find any way to get a reference to the soon-to-be-mounted node; until it's too late (i.e. in mounted when it's already been replaced).