Created
April 6, 2020 21:35
-
-
Save daKmoR/55b3a74d4f6d94fd3fdefda2eeb23a1a to your computer and use it in GitHub Desktop.
Markdium-The evolution of open-wc scoped-elements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LitElement } from 'lit-element'; | |
import { ScopedElementsMixin } from '@open-wc/scoped-elements'; | |
import { MyPanel } from './MyPanel.js'; | |
| |
export class MyElement extends ScopedElementsMixin(LitElement) { | |
static get scopedElements() { | |
return { | |
'my-panel': MyPanel, | |
}; | |
} | |
| |
constructor() { | |
super(); | |
| |
const scopedTagName = this.constructor.getScopedTagName('my-panel'); | |
| |
// do whatever you need with the scopedTagName | |
} | |
| |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment