ForgeKomponenty
pl

Komponenty

j-Empty

jComponent 20 · jcomponent@20 component Przykład załadowany z jComponent 20
  • path musi zawierać źródło danych, które będzie monitorowane

Konfiguracja:

  • icon {String} jako ikona domyślna (default: ti ti-database)
  • parent {String} to rodzinny pojemnik, który ustala minimalną wysokość (default: parent)
  • Wysokość height {Number} (jeśli nie chcesz używać parent, domyślnie: undefined)
  • margin {Number} na margines (default: 0)
  • topoffset {Boolean} stosuje element.offset().top jako marżę (default: false)
  • topposition {Boolean} stosuje element.position().top jako marżę (default: false)
  • NEW wait {Boolean} czeka na dane (default: false)

Przypadek 1:

<ui-component name="empty" path="datasource" class="hidden">
	Items not found
</ui-component>
<ui-bind path="datasource" config="show:value && value.length" class="hidden"></ui-bind>

Przypadek użycia 2:

<ui-component name="empty" path="datasource" class="hidden">
	<script type="text/html">
		Items not found
	</script>
	<div>
		YOUR CONTENT. This DIV will be hidden automatically if the "datasource" is empty.
	</div>
</ui-component

Użyj go z <ui-component name="empty">Gdy element nie jest jeszcze ładowany, jComponent Pobierz go po pierwszym użyciu z adresu DEF.fallback (Wydaje się Componentator Autor: Peter Širka Źródło: Componentator Zestaw składników, licencja MIT.

example.html
<ui-component name="empty" path="datasource" config="parent:window;wait:false" class="hidden">The datasource is empty.</ui-component>

<script>

	var datasource = [];

	// Empty component will be hidden after 5 seconds
	PUSH('datasource', { item: 1 }, 5000);

</script>