HTML Template Tag in Vanilla JavaScript and Vue

Dan Vega on January 26, 2019

For the past few months, I have been writing a ton of documentation, tutorials, and exercises around VueJS and Vanilla JavaScript. Just for some ... [Read Full]
markdown guide
 
 

How would you go about if you wanted to split your HTML template tags in separate files? Is that possible with the new template tag?

 

There is no easy way to include HTML in HTML at the moment. Here is a good article from CSS tricks that walks through some options.

css-tricks.com/the-simplest-ways-t...

 

Thanks for responding :)

I discovered it a little after asking this question here. And ended up reading this article. For the sake of someone in the future with the same problem than me, here's my (still not robust enough) solution: gitlab.com/wtfgraciano/tanana/comm...

Since I'm using electron, none of the solutions from the CSS tricks article were enough for me, I needed to use the file system to "require" the HTML files.

 

Great post! Actually, you can use <template> tags with the full build of Vue (Including Vue via CDN like the traditional way)

 
 
 

I'm pretty sure the template tag doesn't work in IE. I think you can use script/x block as it's replacement, however.

code of conduct - report abuse