Open Nevraeka opened 9 years ago
@csuwildcat - What is the preferred way for x-tag?
First off, you may want to glance over these docs - they're way more detailed than x-tags.org: https://x-tag.readme.io/v1.0/docs (we're just finishing up the last bits before we switch to ReadMe). I noticed you had some functions in your lifecycle that aren't lifecycle callbacks. Any methods you want to add go under the methods: {}
object. The methods
object is a top-level object under your main register object definition.
As for your question, are you asking if there's a built-in fetch mechanism for something like a script tag's src
attribute?
Sorry about that. I moved those methods and I'll go through the docs in further detail ASAP. As far as my question goes, My instinct is to have a custom accessor with a url value that the element can use to fetch a item list of data. I could also have a set of declarative list items or do something else.
<x-carousel items="https://path/to/data_items"></x-carousel>
or/and
<x-carousel>
<item name="first-item">item 1</item>
<item name="second-item">item 2</item>
</x-carousel>
So you want to use a url to do an async fetch of content, or something like datalist's child elements that it uses as the values for autocomplete?
Datalist doc: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist
^ something like that?
Whichever x-tag philosophy prefers but yes either the declarative approach (not <datalist>
per se because of the usage) or the implicit approach ( fetch or other)
Provide a method the is responsible for delegating to a url data fetch as an attribute or an explicit list declared as DOM nodes or local data