j-Message
- Синглът
Конфигуриране:
button {String}етикет за бутон (предварително:OK)style {Number}може да промени стил (предварително:1), стилът на2е подобен на компонентаj-Approvecloseoutside {Boolean}позволява затваряне на кутията за съобщения, като кликнете извън основния бутон
Използване:
SETTER('message/warning', 'Some warning');
SETTER('message/success', 'Some success message');
SETTER('message/info', 'Some info message');Работи с астероид:
- Грешките се обработват автоматично
// Without callback
AJAX('POST /api/profile/', userprofile, ASETTER('message/response', 'Profile has been saved successfully'));
// Or with a callback
AJAX('POST /api/profile/', userprofile, ASETTER('message/response', 'Profile has been saved successfully', function(response) {
console.log(response);
}));
// Or with a callback and without message
AJAX('POST /api/profile/', userprofile, ASETTER('message/response', function(response) {
console.log(response);
}));
// With auto-binding
AJAX('POST /api/profile/', userprofile, ASETTER('message/response', '?.response'));
AJAX('POST /api/profile/', userprofile, ASETTER('message/response', 'Your message', '?.response'));Използвайте го с <ui-component name="message">Когато компонентът все още не е зареден, jComponent Изтегляне на първия адрес в DEF.fallback (След това Componentator Източник: Питър Шерка Componentator Съставни съставки, лиценз на MIT.
<ui-component name="message"></ui-component>
<script>
setTimeout(function() {
SETTER('message/success', 'Success message');
// SETTER('message/warning', 'Warning message');
}, 2000);
</script>