print.html 378 B

1234567891011121314151617181920212223242526272829
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>print-demo</title>
  6. <script src="../dist/template.js"></script>
  7. </head>
  8. <body>
  9. <h1>print</h1>
  10. <script id="test" type="text/html">
  11. {{print a b c}}
  12. </script>
  13. <script>
  14. var html = '';
  15. var data = {
  16. a: 'hello',
  17. b: '--world',
  18. c: '--!!!'
  19. };
  20. html = template('test', data);
  21. document.write(html);
  22. </script>
  23. </body>
  24. </html>