ForgeKomponenter
sv

Komponenter

j-NativeNotifications

jComponent 20 · jcomponent@20 component Exempel laddat med jComponent 20
  • singlar

Konfigurera

  • timeout {Number} behöver innehålla en tidslängd (millisekunder) för utgången av anmälan (default: 8000)
  • icon {String} (alternativt) en ikon (default /icon.png)

Metoder

  • component.append(title, message, [callback], [icon]) för att skapa en ny anmälan

Användning

SETTER('nativenotifications/show', 'TITLE', 'MESSAGE', function() {
    // optional, click
}, '/img/warning-optional.png');

Använd den med <ui-component name="nativenotifications">När komponenten ännu inte är laddad, jComponent Ladda ner den första gången från adressen i DEF.fallback (en av Componentator Författare: Peter Širka. källa: The Componentator Komponenterna i lager, MIT licens.

example.html
<ui-component name="nativenotifications" path="allowNotifications"></ui-component>

<script>
	var allowNotifications = true;

	setTimeout(function() {
		SETTER('nativenotifications/append', 'Hello!', 'jComponent is a great solution for everyone.', null, 'https://messenger.totaljs.com/icon.png');
	}, 3000);
</script>