Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/donejs/done-element

Wrapper for can-element which conditionally loads polyfills for you.
https://github.com/donejs/done-element

Last synced: 12 days ago
JSON representation

Wrapper for can-element which conditionally loads polyfills for you.

Awesome Lists containing this project

README

        

# done-element

[![Build Status](https://travis-ci.org/donejs/done-element.png?branch=master)](https://travis-ci.org/donejs/done-element)

Custom elements for DoneJS projects. This works exactly the same as [can-element](https://github.com/canjs/can-element), but also loads polyfills if needed.

```html

Hello world app

```

```js
import mixinElement from "done-element";
var defineAttr from "done-element/attributes";
import define from "can-define";

const { Element } = minElement;

const view = stache("Hello {{name}}!");

class HelloWorld extends Element {
static get view() {
return view;
}
}

define(HelloWorld.prototype, {
name: {
attribute: true,
value() {
return "world";
}
}
});
defineAttr(HelloWorld);

customElements.define("hello-world", HelloWorld);
```

Will create **Hello DoneJS!**.

## License

MIT