Socket
Socket
Sign inDemoInstall

@aofl/element

Package Overview
Dependencies
5
Maintainers
2
Versions
116
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @aofl/element

aofl-element extends lit-element and overrides the _render() function. It accepts a template function and an String[] of styles. It is intented to be used in place of lit-element as the base class for elements. In it's current version it doesn't do much o


Version published
Weekly downloads
59
increased by7.27%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

@aofl/aofl-element

aofl-element extends lit-element and overrides the _render() function. It accepts a template function and an String[] of styles. It is intented to be used in place of lit-element as the base class for elements. In it's current version it doesn't do much other than provide a clean interface to sperate HTML, CSS and JavaScript context. It makes it easier to change the template on the fly (see @aofl/i18n-mixin.)

Api Documentation

Methods

NameParametersDescription
_render{Function} template, {String[]} stylesRe-evaluate the example code

code example

import {AoflElement} from '@aofl/web-components/aofl-element';
import template from './template.js',
import styles from 'index.css'

class MyElement extends AoflElement {
  static get is() {
    return 'my-element';
  }

  _render() {
    return super.render(template, [styles])
  };
}

customElements.define(MyElement.is, MyElement)

Keywords

FAQs

Last updated on 18 Mar 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc