j-Extend
Този компонент е специфичен компонент с мощна функционалност. Когато компонентът се оценява, той изпълнява два събития в формата по-долу.
Конфигуриране:
name {String}Името за разширяване, компонентът ще емитира събитиеON('extend_' + name)
Компонентът издава само два събития, които можете да уловите някъде:
// 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}
});Използвайте го с <ui-component name="extend">Когато компонентът все още не е зареден, jComponent Изтегляне на първия адрес в DEF.fallback (След това Componentator Източник: Пит Шърка Componentator Съставни съставки, лиценз на 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>