j-Extend
Ten element jest konkretnym składnikiem o potężnej funkcjonalności.Kiedy komponent jest oceniany, to wykonuje dwa wydarzenia w poniższej formie.
Konfiguracja:
name {String}Imię dla rozszerzenia, składnik będzie emitować wydarzenieON('extend_' + name)
Komponent emituje tylko dwa wydarzenia, które można złapać gdzieś:
// NAME: is defined in the component configuration
ON('extend_NAME', function(opt) {
// opt.name {String} with a value according to the "config.name"
// opt.component {Instance of j-Extend}
// opt.element {jQuery element}
// opt.dom {Node}
});
ON('extend', function(opt) {
// opt.name {String} with a value according to the "config.name"
// opt.component {Instance of j-Extend}
// opt.element {jQuery element}
// opt.dom {Node}
});Użyj go z <ui-component name="extend">Gdy element nie jest jeszcze ładowany, jComponent Pobierz go po pierwszym użyciu z adresu DEF.fallback (Wydaje się Componentator Autor: Pete Širka Źródło: Componentator Zestaw składników, licencja MIT.
<div style="width:300px">
<ui-plugin path="form">
<ui-component name="extend" config="name:test"></ui-component>
</ui-plugin>
</div>
<script>
ON('extend_test', function(opt) {
// Here you can use IMPORT() method
opt.element.append(`
<div class="m">Extended:</div>
<ui-component name="input" path="?.name" config="required:1">Label</ui-component>
`);
});
</script>