JustHTML.js 461 B

123456789101112131415161718
  1. const Component = use('util.Component');
  2. /**
  3. * Allows using an HTML string as a component.
  4. */
  5. export default def(class JustHTML extends Component {
  6. static ID = 'ui.component.JustHTML';
  7. static PROPERTIES = { html: { value: '' } };
  8. create_template ({ template }) {
  9. $(template).html(`<span></span>`);
  10. }
  11. on_ready ({ listen }) {
  12. listen('html', html => {
  13. $(this.dom_).find('span').html(html);
  14. });
  15. }
  16. });