How best to define custom elements?

46 views
Skip to first unread message

Matt DeMoss

unread,
Aug 22, 2019, 5:09:02 PM8/22/19
to TiddlyWikiDev
I've implemented a custom element for recurring tasks. I found this easier than implementing the same thing as a widget module, which seems to require constructing HTML indirectly via objects describing elements.

How should this best be organized as a TW5 plugin? My initial thoughts are that the JS that defines the custom element and calls customElements.define should be a "startup" module while the template could be stored in an HTML tiddler.

Jeremy Ruston

unread,
Aug 24, 2019, 5:16:06 AM8/24/19
to TiddlyWikiDev
Hi Matt

I've implemented a custom element for recurring tasks. I found this easier than implementing the same thing as a widget module, which seems to require constructing HTML indirectly via objects describing elements.

Interesting! And should work well for some cases.

How should this best be organized as a TW5 plugin? My initial thoughts are that the JS that defines the custom element and calls customElements.define should be a "startup" module while the template could be stored in an HTML tiddler.

That sounds exactly right. 

Best wishes

Jeremy
Reply all
Reply to author
Forward
0 new messages