@acutejs/plugin-lit-html

A plugin for Acute to use lit-html.

Usage no npm install needed!

<script type="module">
  import acutejsPluginLitHtml from 'https://cdn.skypack.dev/@acutejs/plugin-lit-html';
</script>

README

@acutejs/plugin-lit-html

A plugin for Acute to use lit-html.

Usage

First, install the plugin and its peer-dependency, lit-html.

npm install @acutejs/plugin-lit-html lit-html

Next, pass the plugin and a reference to lit-html’s render function to Acute’s createApp().

import litHtml from '@acutejs/plugin-lit-html';
import { render } from 'lit-html';

createApp({
  // ...
  plugins: [
    litHtml({
      render,
    }),
  ],
});

Finally, use lit-html’s html function to tag the template string in your components render() function.

import { html } from 'lit-html';

const message = 'Hello, world';

export default {
  render() {
    return html`<p> ${message} </p>`;
  },
};